Skip to content

Persistent websocket disconnect / reconnect loop (Broken pipe, os error 32) on macOS #44099

Open

Description

@stankovicvukasin15-cmd

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

26.901.51231

What subscription do you have?

Pro

What platform is your computer?

Darwin 25.3.0 arm64 arm Apple M-series

What issue are you seeing?

Symptom

Mid-turn the stream dies and the client enters a reconnect loop: "Reconnecting... 1/5" through "5/5". Each retry stalls for minutes, so a request that should take 10 seconds takes 13+ minutes or never completes. Once the loop starts, the thread is effectively dead.

Errors seen

stream disconnected before completion: websocket closed by server before response.completed
stream disconnected before completion: failed to send websocket request: IO error: Broken pipe (os error 32)
Falling back from WebSockets to HTTPS transport

Noticeably worse on turns that read multiple images.

Environment

  • Bundled codex-cli 0.153.4
  • Model: gpt-6-astra, reasoning effort medium and high, service_tier default
  • Auth: ChatGPT subscription login (not API key)
  • Home network, no VPN, no proxy

What I already tried (no effect)

  • responses_websockets = false and responses_websockets_v2 = false in config.toml (these appear to be removed flags)
  • Custom model_provider with supports_websockets = false, plus stream_max_retries = 1
  • Disabling all 13 plugins (computer-use, chrome, browser, unified-computer-use, sites, visualize, documents, pdf, spreadsheets, presentations, template-creator, etc.)
  • Running the bundled Codex CLI in Terminal instead of the app — same failure
  • Machine restart, fresh sessions, different network (mobile hotspot), incognito

The web version of ChatGPT works reliably on the same account and same network.

Requests

  1. Websocket keepalive so a dead stream is detected in seconds instead of 300s.
  2. Fall back to HTTPS on the first idle timeout, not the fifth.
  3. A supported way to force HTTPS-only transport for ChatGPT-login users.

What steps can reproduce the bug?

  1. Open the Codex app on macOS, signed in with a ChatGPT subscription (Pro).
  2. Start a task in a project folder — reading and comparing several local images makes it fire much more often.
  3. Send a normal prompt and wait.
  4. Mid-turn the stream goes silent, then "Reconnecting... 1/5" appears and counts up to 5/5, each retry stalling for minutes.

Happens across fresh sessions, different models, and different times of day. Not tied to one thread.

What is the expected behavior?

The stream should stay alive until the turn completes. If the websocket does drop, the client should detect it within seconds and fall back to HTTPS immediately, rather than stalling ~5 minutes per retry across 5 retries before falling back.

Additional information

Other users report the same thing — see the r/codex thread "The 'Stream disconnected before completion' error seems to be happening more frequently than ever" and related issues in this repo (#38638, #28503, #19804, #19821).

One user reported the problem stopped for them after disabling most of their skills and plugins. I disabled all 13 of mine and it made no difference in my case.

Happy to provide session IDs or logs if that helps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingconnectivityIssues involving networking or endpoint connectivity problems (disconnections)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions