codex - 💡(How to fix) Fix Codex session repeatedly disconnects: websocket closed before response.completed

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…

While running a Codex task, the connection became very unstable and repeatedly showed reconnecting behavior. The session eventually surfaced this error:

stream disconnected before completion: websocket closed by server before response.completed

The UI showed reconnect attempts such as Reconnecting... 2/5 during the task.

Error Message

While running a Codex task, the connection became very unstable and repeatedly showed reconnecting behavior. The session eventually surfaced this error:

Root Cause

While running a Codex task, the connection became very unstable and repeatedly showed reconnecting behavior. The session eventually surfaced this error:

stream disconnected before completion: websocket closed by server before response.completed

The UI showed reconnect attempts such as Reconnecting... 2/5 during the task.

Code Example

stream disconnected before completion: websocket closed by server before response.completed
RAW_BUFFERClick to expand / collapse

Summary

While running a Codex task, the connection became very unstable and repeatedly showed reconnecting behavior. The session eventually surfaced this error:

stream disconnected before completion: websocket closed by server before response.completed

The UI showed reconnect attempts such as Reconnecting... 2/5 during the task.

Feedback ID

019e62a9-9544-7780-864a-566226a188ac

Environment

  • Codex app version: 26.519.41501 (3044)
  • macOS: Tahoe 26.5
  • Device: MacBook Pro 16-inch, Apple M5 Max, 128 GB memory
  • Network: home network, no VPN enabled

Expected behavior

Codex should keep the session stream stable until the task completes, or recover cleanly after a transient reconnect without losing the response/completion state.

Actual behavior

The stream disconnected before completion and the websocket was closed by the server before response.completed, causing the task to become unstable instead of finishing normally.

<img width="2102" height="260" alt="Image" src="https://github.com/user-attachments/assets/9eb2fd65-100b-46fd-80cb-59e6af764612" />

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…

FAQ

Expected behavior

Codex should keep the session stream stable until the task completes, or recover cleanly after a transient reconnect without losing the response/completion state.

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 session repeatedly disconnects: websocket closed before response.completed