Codex App Remote SSH fails on macOS remote because bootstrap uses GNU-style chmod --

Resolved 💬 4 comments Opened May 1, 2026 by AdithyanI Closed Aug 4, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

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

26.429.20946

What subscription do you have?

ChatGPT Pro ($200/mo)

What platform is your computer?

Local client:

Darwin 25.3.0 arm64 arm

Remote SSH host:

Darwin 25.3.0 arm64 arm

Local and remote Codex CLI:

codex-cli 0.128.0

What issue are you seeing?

Codex App Remote Connections discovers a macOS SSH host and can run remote probes, but enabling the connection fails with:

Error: Codex app-server websocket closed (code=1006)

The local Codex App logs show the remote SSH bootstrap command includes GNU-style chmod --:

umask 077; mkdir -p -- "${CODEX_HOME:-$HOME/.codex}/app-server-control" && chmod 700 -- "${CODEX_HOME:-$HOME/.codex}/app-server-control" && nohup codex app-server --listen unix:// >"${CODEX_HOME:-$HOME/.codex}/app-server-control/app-server.log" 2>&1 &

On macOS/BSD, /bin/chmod does not accept a standalone -- end-of-options marker, so the bootstrap fails with:

chmod: --: No such file or directory

The control socket is never created, and then the proxy step fails:

Error: failed to connect to socket at $HOME/.codex/app-server-control/app-server-control.sock

Caused by:
    No such file or directory (os error 2)

This is surfaced in the UI only as the generic websocket 1006 error.

What steps can reproduce the bug?

  1. Use Codex App on macOS.
  2. Add/connect to another macOS host via Settings -> Connections -> Remote SSH.
  3. Ensure the remote host uses standard macOS /bin/chmod.
  4. Enable the connection.
  5. Observe Codex app-server websocket closed (code=1006).

Manual proof on the remote macOS host:

# Exact bootstrap shape emitted by Codex App
exact_rc=1
exact_stderr=
chmod: --: No such file or directory
exact_socket_exists=no

# Same command with only chmod changed to BSD-compatible syntax
fixed_rc=0
fixed_stderr=
fixed_socket_exists=yes

After manually starting the app-server with BSD-compatible chmod syntax, the socket exists and proxy succeeds:

socket_exists=yes
$HOME/.codex/app-server-control/app-server-control.sock

proxy_status=exited
proxy_rc=0
proxy_stderr=

What is the expected behavior?

Remote SSH bootstrap should work on macOS remotes. The bootstrap command should either avoid chmod -- or use a portable form such as:

chmod 700 "${CODEX_HOME:-$HOME/.codex}/app-server-control"

Additional information

SSH itself works. Codex App can discover the host and run remote codex --version probes. The failure appears to be in the Desktop Remote Connections bootstrap command, not SSH reachability or the remote Codex CLI installation.

Related but not exact duplicates found while searching:

  • #19302: Remote SSH bootstrap with csh/tcsh login shells
  • #19300: stale remote app-server state masking errors
  • #19688: UDS handshake issue, closed and not the same failure mode

View original on GitHub ↗

4 Comments

jnordlund · 3 months ago

Seeing the same with
codex-cli 0.128.0
Codex App Version 26.429.20946 (2312)
on macOS Darwin Kernel Version 25.4.0

HJXA · 3 months ago

same questions in mac to ssh linux (codex 0.128.0 in linux)

HJXA · 3 months ago

I think it has been fixed in the latest Codex APP (26.430.10722)?

Seeing the same with codex-cli 0.128.0 Codex App Version 26.429.20946 (2312) on macOS Darwin Kernel Version 25.4.0
### What version of the Codex App are you using (From “About Codex” dialog)? 26.429.20946 ### What subscription do you have? ChatGPT Pro ($200/mo) ### What platform is your computer? Local client: `` Darwin 25.3.0 arm64 arm ` Remote SSH host: ` Darwin 25.3.0 arm64 arm ` Local and remote Codex CLI: ` codex-cli 0.128.0 ` ### What issue are you seeing? Codex App Remote Connections discovers a macOS SSH host and can run remote probes, but enabling the connection fails with: ` Error: Codex app-server websocket closed (code=1006) ` The local Codex App logs show the remote SSH bootstrap command includes GNU-style chmod --: umask 077; mkdir -p -- "${CODEX_HOME:-$HOME/.codex}/app-server-control" && chmod 700 -- "${CODEX_HOME:-$HOME/.codex}/app-server-control" && nohup codex app-server --listen unix:// >"${CODEX_HOME:-$HOME/.codex}/app-server-control/app-server.log" 2>&1 & On macOS/BSD, /bin/chmod does not accept a standalone -- end-of-options marker, so the bootstrap fails with: ` chmod: --: No such file or directory ` The control socket is never created, and then the proxy step fails: ` Error: failed to connect to socket at $HOME/.codex/app-server-control/app-server-control.sock Caused by: No such file or directory (os error 2) ` This is surfaced in the UI only as the generic websocket 1006 error. ### What steps can reproduce the bug? 1. Use Codex App on macOS. 2. Add/connect to another macOS host via Settings -> Connections -> Remote SSH. 3. Ensure the remote host uses standard macOS /bin/chmod. 4. Enable the connection. 5. Observe Codex app-server websocket closed (code=1006). Manual proof on the remote macOS host: ` # Exact bootstrap shape emitted by Codex App exact_rc=1 exact_stderr= chmod: --: No such file or directory exact_socket_exists=no # Same command with only chmod changed to BSD-compatible syntax fixed_rc=0 fixed_stderr= fixed_socket_exists=yes ` After manually starting the app-server with BSD-compatible chmod syntax, the socket exists and proxy succeeds: ` socket_exists=yes $HOME/.codex/app-server-control/app-server-control.sock proxy_status=exited proxy_rc=0 proxy_stderr= ` ### What is the expected behavior? Remote SSH bootstrap should work on macOS remotes. The bootstrap command should either avoid chmod -- or use a portable form such as: chmod 700 "${CODEX_HOME:-$HOME/.codex}/app-server-control" ### Additional information SSH itself works. Codex App can discover the host and run remote codex --version` probes. The failure appears to be in the Desktop Remote Connections bootstrap command, not SSH reachability or the remote Codex CLI installation. Related but not exact duplicates found while searching: Remote SSH connection fails when remote login shell is csh/tcsh #19302: Remote SSH bootstrap with csh/tcsh login shells Remote SSH Desktop reuses stale app-server and masks model_not_found as Reconnecting #19300: stale remote app-server state masking errors * app-server UDS closes standard WebSocket-over-UDS handshake #19688: UDS handshake issue, closed and not the same failure mode
etraut-openai contributor · 24 days ago

Remote macOS chmod -- bootstrap failure was fixed in the subsequent build.