Repository navigation
Description
What happened?
Codex Desktop Remote Connections can discover an SSH host from ~/.ssh/config, but enabling the connection fails during remote app-server bootstrap when the remote account's login shell is /bin/csh.
Normal SSH to the host succeeds, passwordless auth works, and the remote has both /bin/bash and /bin/sh installed. The remote codex app-server --help command also works when run manually. The failure appears to happen because the Desktop remote bootstrap is executed through the remote login shell and uses Bourne/bash-style syntax or -l flags that csh does not accept.
Sanitized log excerpt
[remote-connections/discovery] discovery_completed collectedAliasCount=1 ... resolvedConnectionCount=1
[WindowContext] [ssh-websocket-v0] selected app-server transport websocketUrl=ws://127.0.0.1:<local-port>/rpc
[AppServerTransportSshWebsocket] ssh_websocket_v0.ensure_remote_app_server_and_tunnel localPort=<local-port> remotePort=<remote-port> sshAlias=<redacted> sshHost=<redacted> sshPort=<redacted>
[AppServerConnection] app_server_connection.transport_connect_failed
errorMessage="Unmatched '''.
fi: Command not found.
Unknown option: `-l'
Usage: csh [ -bcdefilmnqstvVxX ] [ argument ... ]."
Environment
- Codex Desktop on Windows
- Codex app version observed in local install/logs:
26.422.2437.0 - Remote app-server version reported by logs:
0.124.0-alpha.2 - Remote host: Unix/Linux via SSH
- Remote login shell:
/bin/csh /bin/bashand/bin/share available on the remote- SSH auth works normally outside Codex Desktop
- Host alias, hostname, user, and ports intentionally redacted
Expected behavior
Codex Desktop Remote Connections should either:
- bootstrap through a POSIX shell explicitly, e.g.
/bin/sh -lc ..., regardless of the account login shell; - support
csh/tcshlogin shells with compatible syntax; or - expose a per-connection "remote bootstrap shell" setting, e.g.
/bin/bash, so users can keep their login shell ascshfor existing remote workflows.
Why changing the login shell is not always viable
Some enterprise environments require csh/tcsh login shells for existing tool setup. In this environment the shell is managed by central account tooling and cannot be changed locally. Users may need to keep csh as the login shell while allowing Codex to use sh/bash only for its bootstrap.
Activity
github-actions commentedon Apr 24, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
vananth-nv commentedon Apr 24, 2026
include csh/tcsh in the bug if you want to close this as duplicate @codex
maybejeb commentedon Sep 24, 2026
Additional impact: remote diagnostics must preserve the account's login shell
I encountered the same C-shell compatibility boundary in a managed Linux remote-workflow environment, but at the diagnostic layer rather than only during app-server bootstrap.
Environment
Observed behavior
A remote diagnostic was wrapped in Bash before the remote account's login shell was identified. That changed the effective initialization and PATH, and produced a false negative:
That result did not establish that Codex was absent from the host. It established only that it was unavailable in the prematurely selected Bash environment. The account's actual interactive workflow is C-shell, where the required tooling is initialized differently.
This class of error is costly because it can send an agent down an incorrect troubleshooting path and consume time/quota while investigating a shell-induced false negative.
Root cause
The diagnostic chose /bin/bash as an implementation convenience before establishing the remote user's configured login shell. On enterprise hosts, C-shell startup can provide required PATH, proxy, module, and tool initialization. A Bash wrapper is therefore not an equivalent observation environment.
Expected behavior
Before making environment-sensitive claims such as command not found, remote workflows should:
Suggested regression coverage
Add a remote C-shell fixture whose startup environment exposes a command not present in Bash. Verify that bootstrap and diagnostic paths either preserve the configured shell or explicitly report the shell override; they must not report a host-level missing-command conclusion based only on the override.
This is complementary to the existing C-shell bootstrap failure: shell selection affects not only initial app-server startup, but also the correctness of subsequent remote diagnosis.
Anonymized recurrence evidence: 250 recent local session records
To check whether this was an isolated incident, I reviewed 250 readable local Codex session records spanning roughly four months. This was a local, anonymized review: no hostnames, user names, file paths, command contents, credentials, or transcript excerpts are included here.
The figures below are session-level signals, not a claim that every match is an independently adjudicated defect. One session can match more than one category. Even with that conservative caveat, the recurrence is substantial:
2>&1,$(...),[[,export)command not foundfalse leadThese are not merely cosmetic command translations. In a C-shell-dependent engineering environment, each occurrence can create an avoidable failed attempt, an incorrect PATH diagnosis, repeated environment discovery, and additional interactive agent work. That is costly in elapsed engineering time and in metered agent/token usage, particularly when the agent loses context and retries a Bash-shaped solution.
The recurring failure pattern is: assume Bash first; discover the actual login shell only after a failure. The safe product behavior should be the reverse: detect and report the effective remote login shell before generating shell syntax, selecting startup files, changing PATH assumptions, or treating a command lookup failure as evidence that a tool is absent.
Suggested regression gate: a remote
/bin/cshor/bin/tcshfixture that asserts (1) shell detection precedes command construction, (2) generated diagnostics use valid C-shell syntax, (3) Bash is used only for an explicit, labeled Bash requirement, and (4) command-not-found results are not generalized across shell initialization contexts.