macOS app 26.608.12217: launch crash 'Uncaught Exception: WebSocket was closed before the connection was established' when SSH remote fails to bootstrap (regression from 26.602)

Open 💬 1 comment Opened Jun 10, 2026 by nicolaus-huang

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

26.608.12217 (macOS desktop app)

What subscription do you have?

ChatGPT Pro

What platform is your computer?

macOS, Apple Silicon (arm64)

What issue are you seeing?

Since updating to 26.608.12217 today, the app shows a main-process crash dialog on every launch:

Uncaught Exception:
Error: WebSocket was closed before the connection was established
at e.terminate (.../app.asar/.vite/build/src-K8ZToA-n.js:374:32003)
at .../main-CIL4OHS5.js:91:1394
at async Zg.runWithSshStartupGate (main-CIL4OHS5.js:92:7634)
at async nI.connectAndWaitForOpen (src-K8ZToA-n.js:368:48187)
at async nI.startAppServerProcess (src-K8ZToA-n.js:368:46158)

From app logs (~/Library/Logs/com.openai.codex/...), the trigger is a configured SSH remote connection that fails to bootstrap via the ssh_websocket_v0 transport:

  1. SSH auth to the remote host succeeds (publickey).
  2. The app runs the remote bootstrap: codex app-server proxy --sock "${CODEX_HOME:-$HOME/.codex}/app-server-control/desktop-ssh-websocket-v0.sock" — but the proxy never starts on the remote.
  3. The WebSocket upgrade request bytes are consumed by the remote login shell instead. stderr captured in ssh_websocket_v0.proxy_command_failed (code=255):
/bin/bash: line 2: Sec-WebSocket-Version:: command not found
/bin/bash: line 3: Sec-WebSocket-Key:: command not found
/bin/bash: line 4: Connection:: command not found
/bin/bash: line 5: Upgrade:: command not found
/bin/bash: line 6: Host:: command not found
Killed by signal 15.
  1. app_server_connection.transport_connect_failed errorMessage="SSH websocket open timed out", and terminating the still-CONNECTING local WebSocket throws WebSocket was closed before the connection was established, which is not caught inside runWithSshStartupGate -> Electron main-process Uncaught Exception dialog.

Regression note: the same remote had been failing for days on 26.602.x, but failed gracefully (logs show ssh_websocket_v0.remote_codex_version_probe_failed; no crash dialog). On 26.608.12217 the version-probe events no longer appear and the same failure now crashes the main process on every launch.

<img width="972" height="752" alt="Image" src="https://github.com/user-attachments/assets/a4a549cd-a1b1-4df1-8777-48a102c35dd5" />

What steps can reproduce the bug?

  1. Configure an SSH remote connection whose host cannot start codex app-server proxy (e.g. outdated/missing codex CLI on the remote, or login-shell rc scripts interfering with the bootstrap).
  2. Update the macOS desktop app to 26.608.12217 and launch it.
  3. The app auto-reconnects to the SSH remote on startup; the "Uncaught Exception" dialog appears on every launch while the connection retries in a loop.

What is the expected behavior?

An SSH remote bootstrap failure should surface as a connection error in the UI (as 26.602.x did), not as an unhandled exception dialog from the main process. Terminating a CONNECTING WebSocket inside runWithSshStartupGate / connectAndWaitForOpen should be caught.

Additional information

  • Local (non-SSH) projects work fine in the same session; only the SSH remote path crashes.
  • Yesterday's version per logs: 26.602.40724 / 26.602.71036 (no dialog). Today: 26.608.12217 (dialog on every launch).
  • Happy to attach sanitized logs from ~/Library/Logs/com.openai.codex if useful.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗