codex - 💡(How to fix) Fix Codex App should not auto-select or probe SSH config hosts without explicit opt-in [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#20505Fetched 2026-05-01 05:42:23
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4

Root Cause

This is surprising because an SSH config entry is not the same thing as granting Codex permission to use/probe that host. I would expect Codex to list possible remotes, but not auto-select or connection-check/probe them until I explicitly choose to connect.

Fix Action

Fix / Workaround

The practical workaround is to remove or comment out stale entries from ~/.ssh/config, but that is not obvious because users may reasonably keep old SSH host aliases for reference or manual use outside Codex.

Code Example

codex-cli 0.128.0

---

Host 192.168.1.181
  HostName 192.168.1.181
  User <user>

---

selected-remote-host-id = remote-ssh-discovered:192.168.1.181

---

[remote-connections/discovery] discovery_started entrypointPath=C:\Users\<user>\.ssh\config savedRemoteConnectionAliasCount=0
[remote-connections/discovery] discovery_completed collectedAliasCount=6 collectedAliases=["192.168.1.33","192.168.1.181", ...] resolvedConnectionCount=6
[remote-connections/selection] persisted_selection_reconciled availableConnectionCount=6 persistedSelectedRemoteHostId=undefined selectedConnectionState=selected selectedRemoteHostId=remote-ssh-discovered:192.168.1.181
remote_connections.manager_state_set hostId=remote-ssh-discovered:192.168.1.181 nextState=disconnected source=bootstrap_connection_state_fetch

---

Host 192.168.1.181
     HostName 192.168.1.181
     User <user>

---

C:\Users\<user>\AppData\Local\Packages\OpenAI.Codex_*\LocalCache\Local\Codex\Logs\
RAW_BUFFERClick to expand / collapse

What version of the Codex App are you using (From "About Codex" dialog)?

Windows app package: OpenAI.Codex_26.429.2026.0_x64__2p2nqsd0c76g0

Bundled CLI shown in PowerShell:

codex-cli 0.128.0

What subscription do you have?

ChatGPT paid subscription

What platform is your computer?

Windows x64

What issue are you seeing?

Codex App automatically discovers SSH hosts from ~/.ssh/config, selects a discovered host, and checks connection state during startup without an explicit user action to enable/use that remote host.

In my case, C:\Users\<user>\.ssh\config contained a stale LAN host:

Host 192.168.1.181
  HostName 192.168.1.181
  User <user>

No current device was using that address, and it was not reachable. Even so, Codex Desktop repeatedly discovered it and persisted it as:

selected-remote-host-id = remote-ssh-discovered:192.168.1.181

The app logs also showed it checking state for all discovered SSH hosts on startup:

[remote-connections/discovery] discovery_started entrypointPath=C:\Users\<user>\.ssh\config savedRemoteConnectionAliasCount=0
[remote-connections/discovery] discovery_completed collectedAliasCount=6 collectedAliases=["192.168.1.33","192.168.1.181", ...] resolvedConnectionCount=6
[remote-connections/selection] persisted_selection_reconciled availableConnectionCount=6 persistedSelectedRemoteHostId=undefined selectedConnectionState=selected selectedRemoteHostId=remote-ssh-discovered:192.168.1.181
remote_connections.manager_state_set hostId=remote-ssh-discovered:192.168.1.181 nextState=disconnected source=bootstrap_connection_state_fetch

This caused slower startup while Codex was apparently dealing with a stale SSH target that I had not explicitly asked it to connect to. Removing/commenting the stale Host 192.168.1.181 block from ~/.ssh/config made startup noticeably faster.

This is surprising because an SSH config entry is not the same thing as granting Codex permission to use/probe that host. I would expect Codex to list possible remotes, but not auto-select or connection-check/probe them until I explicitly choose to connect.

What steps can reproduce the bug?

  1. On Windows, add a stale or unreachable LAN host to C:\Users\<user>\.ssh\config, for example:

    Host 192.168.1.181
      HostName 192.168.1.181
      User <user>
  2. Start Codex App.

  3. Observe the desktop logs under:

    C:\Users\<user>\AppData\Local\Packages\OpenAI.Codex_*\LocalCache\Local\Codex\Logs\
  4. Codex discovers the SSH config entry and reconciles/selects it as a remote host.

  5. Codex checks connection state for the discovered host even though the user did not explicitly connect to it.

  6. Startup is slower if the host is stale or unreachable.

  7. Comment out or remove the stale Host block and restart Codex. Startup improves and the stale host is no longer discovered.

What is the expected behavior?

Codex App should not auto-select or probe SSH hosts discovered from ~/.ssh/config without explicit user intent.

Expected behavior:

  • Reading ~/.ssh/config to populate a possible remote list is fine.
  • Do not select a discovered SSH host automatically unless the user previously selected it and it still exists.
  • Do not connect/probe/check state for discovered SSH hosts until the user explicitly chooses to use remote SSH.
  • Provide a setting to disable SSH host discovery entirely.
  • Treat ~/.ssh/config entries as candidates, not as permission to access remote hosts.

Additional information

This is related to, but distinct from, stale discovered-host crash behavior reported in #18974. That issue covers failure after a discovered host is removed. This report is only about SSH discovery/selection/probing behavior: Codex Desktop should not auto-select or probe SSH config hosts unless the user explicitly opts in.

The practical workaround is to remove or comment out stale entries from ~/.ssh/config, but that is not obvious because users may reasonably keep old SSH host aliases for reference or manual use outside Codex.

extent analysis

TL;DR

To fix the issue, remove or comment out stale SSH host entries from the ~/.ssh/config file to prevent Codex App from auto-selecting and probing them.

Guidance

  • Verify that the issue is caused by stale SSH host entries in ~/.ssh/config by checking the Codex App logs for discovery and connection attempts to unreachable hosts.
  • Remove or comment out stale SSH host entries from ~/.ssh/config to prevent Codex App from discovering and probing them.
  • Consider adding a setting to disable SSH host discovery entirely to prevent similar issues in the future.
  • Be aware that keeping old SSH host aliases for reference or manual use outside Codex may cause issues with Codex App's auto-discovery feature.

Example

No code snippet is necessary for this issue, as it is related to configuration file management.

Notes

This issue is specific to the Codex App's behavior on Windows and may not apply to other platforms. The workaround may not be obvious to users who keep old SSH host aliases for reference or manual use outside Codex.

Recommendation

Apply the workaround by removing or commenting out stale SSH host entries from ~/.ssh/config, as this is a straightforward and effective solution to the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Codex App should not auto-select or probe SSH config hosts without explicit opt-in [1 participants]