fix(terminal): prefer host IP for SSH sessions#1455
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9f004e884e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if useful := FilterHostIdentityIPs(ipAddresses); len(useful) > 0 { | ||
| return useful[0] |
There was a problem hiding this comment.
Preserve fallback targets when choosing SSH host
Returning only useful[0] makes terminal connection success depend on the first reported IP, with no retry to hostname or other candidate IPs. For multihomed hosts (for example IPv6 reported before IPv4, or VPN/LAN address ordering), the first IP can be unreachable from ingest, and openSSHSession then performs a single ssh.Dial to that literal address and fails even though another recorded address (or the hostname) would work. This is a regression from the previous hostname-first behavior and can block terminal access for affected hosts.
Useful? React with 👍 / 👎.
Summary
Validation