codex - 💡(How to fix) Fix Codex sometimes fails during automatic context compaction with "stream disconnected before completion" [1 comments, 2 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#19538Fetched 2026-04-26 05:15:36
View on GitHub
Comments
1
Participants
2
Timeline
9
Reactions
0
Author
Timeline (top)
labeled ×5cross-referenced ×2closed ×1commented ×1

Error Message

Codex intermittently fails during automatic context compaction with this error: Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact) Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)

RAW_BUFFERClick to expand / collapse

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

26.423.10653

What subscription do you have?

plus

What platform is your computer?

windows x64

What issue are you seeing?

Codex intermittently fails during automatic context compaction with this error:

Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)

It seems the remote compact request is interrupted before completion.

What steps can reproduce the bug?

  1. Open Codex App.
  2. Work in a long session until automatic context compaction is triggered.
  3. When Codex starts the remote compact task, it sometimes fails with:

Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)

The issue is intermittent and may require a long session to reproduce.

What is the expected behavior?

No response

Additional information

No response

extent analysis

TL;DR

The issue may be resolved by improving the stability of the network connection or adjusting the timeout settings for the remote compact task.

Guidance

  • Verify the network connection stability during long sessions to ensure it's not causing the stream disconnection.
  • Check if there are any firewall or proxy settings that might be interrupting the request to https://chatgpt.com/backend-api/codex/responses/compact.
  • Consider testing the Codex App in a different network environment to isolate the issue.
  • If the issue persists, try to reproduce it with a shorter session to gather more information about the failure.

Notes

The intermittent nature of the issue makes it challenging to provide a definitive fix. Further investigation into the network environment and the Codex App's configuration may be necessary.

Recommendation

Apply workaround: Adjust the network settings or timeout configurations to improve the stability of the remote compact task, as the root cause seems to be related to network connectivity rather than a specific version issue.

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