codex - 💡(How to fix) Fix VS Code extension: infinite reconnect loop + "stream disconnected before completion" [3 comments, 3 participants]

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…
GitHub stats
openai/codex#17199Fetched 2026-04-10 03:44:09
View on GitHub
Comments
3
Participants
3
Timeline
9
Reactions
0
Author
Timeline (top)
labeled ×4commented ×3cross-referenced ×1unlabeled ×1

Error Message

  • fail once with a clear error

Root Cause

This was initially suspected to be caused by a very large long-running chat, but the same behavior was reproduced in a completely fresh chat/session.

RAW_BUFFERClick to expand / collapse

What version of the IDE extension are you using?

26.5406.31014 (pre-release); also reproduced on 26.406.31014 (stable)

What subscription do you have?

ChatGPT Go

Which IDE are you using?

VS Code

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

What issue are you seeing?

The VS Code Codex extension repeatedly enters a reconnect loop and fails to complete responses.

Symptoms:

  • "Reconnecting... 1/5 → 5/5" loops continuously
  • Eventually fails with: "stream disconnected before completion"
  • Response begins but disconnects mid-stream
  • Retry loop does not recover

Key observation:

  • This also happens in completely fresh chats / sessions
  • So it does NOT appear to be related to large context size or long threads

What I already tried:

  • Fresh chat/session
  • Forked chat
  • Switched between stable and pre-release extension versions
  • Issue still persists

Versions tested:

  • Pre-release: 26.5406.31014
  • Stable: 26.406.31014

Example request ID from one failure: fd0ab001-6841-4796-8cf8-5fc3d99a8789

What steps can reproduce the bug?

  1. Open Codex in VS Code
  2. Start a session or open a chat
  3. Send a prompt
  4. Response begins streaming normally
  5. Mid-response, the stream disconnects
  6. Extension enters reconnect loop:
    • "Reconnecting... 1/5" through "5/5"
  7. Retry loop fails and response does not complete

Also reproduced in:

  • Completely fresh chats
  • Both stable and pre-release extension versions

What is the expected behavior?

Codex responses should stream normally and complete without entering repeated reconnect attempts.

If a temporary connection interruption happens, the extension should either:

  • recover cleanly and continue the response, or
  • fail once with a clear error

It should not get stuck in a reconnect loop where the response never completes.

Additional information

This was initially suspected to be caused by a very large long-running chat, but the same behavior was reproduced in a completely fresh chat/session.

That seems to rule out context size or my i3-5005U as a low power chip as the root cause.

This issue appears more likely to be related to streaming / reconnect handling in the VS Code extension or backend connection path.

extent analysis

TL;DR

The issue can be mitigated by investigating and potentially adjusting the streaming or reconnect handling in the VS Code Codex extension or backend connection path.

Guidance

  • Investigate the extension's reconnect logic to ensure it properly handles temporary connection interruptions and can recover cleanly.
  • Verify if the issue persists when using a different network connection or environment to isolate if the problem is specific to the local setup.
  • Check for any similar issues reported in the extension's repository or support channels to see if other users have found workarounds or fixes.
  • Consider enabling any available debugging or logging features in the extension to gather more detailed information about the reconnect loop and disconnection events.

Example

No specific code snippet can be provided without more details on the extension's internal workings, but reviewing the reconnect logic and error handling in the extension's codebase may yield insights.

Notes

The root cause of the issue appears to be related to how the extension handles streaming and reconnects, rather than issues with the chat context size or hardware. Further investigation into the extension's code and behavior is needed to pinpoint the exact cause.

Recommendation

Apply workaround: Given the information available, it seems that adjusting or debugging the reconnect handling in the extension might provide a temporary solution until a more permanent fix can be implemented.

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…

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 VS Code extension: infinite reconnect loop + "stream disconnected before completion" [3 comments, 3 participants]