codex - 💡(How to fix) Fix Repeated Compact-related ERROR & Stuck in Working [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#20439Fetched 2026-05-01 05:43:06
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Error Message

This issue happens frequently when the remaining context capacity drops to around 10%. The following error keeps appearing repeatedly: ■ Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)

Code Example

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 Codex CLI is running?

0.125.0

What subscription do you have?

Plus

Which model were you using?

GPT-5.5

What platform is your computer?

Darwin 25.3.0 x86_64 i386

What terminal emulator and version are you using (if applicable)?

VSCode

What issue are you seeing?

This issue happens frequently when the remaining context capacity drops to around 10%. The following error keeps appearing repeatedly:

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

In short, no matter how many times I retry, the session stays stuck on Working... and nothing moves at all. Just to double-check, I ran the Nettop command and confirmed there is zero communication with the server.

It looks like there is a bug in the automatic Compact function.

Restarting the session or clearing the cache does not fix the problem. With no other options, I had to create a new Session, pass the ID of the stuck session, and instruct it to continue from there. However, getting completely stuck in a state where I have no idea what caused it was an extremely unproductive and frustrating development experience.

Please fix this urgently.

What steps can reproduce the bug?

Uploaded thread: 019dd7d4-365e-7fa0-a4bd-1b1a8dd09eb0

What is the expected behavior?

No response

Additional information

No response

extent analysis

TL;DR

The issue can likely be mitigated by avoiding low remaining context capacity, potentially by optimizing the usage of the Codex CLI or adjusting the session settings to prevent the compact task from failing due to a stream disconnection.

Guidance

  • Investigate the cause of the low remaining context capacity to prevent the compact task from failing, possibly by optimizing the input or adjusting the model settings.
  • Consider implementing a retry mechanism with a backoff strategy to handle temporary disconnections or stream errors.
  • Review the session settings and the Codex CLI configuration to ensure that they are optimized for the specific use case and model (GPT-5.5) being used.
  • Check the Codex CLI documentation for any known issues or limitations related to the compact task and low remaining context capacity.

Notes

The provided information suggests that the issue is related to the compact task failing due to a stream disconnection when the remaining context capacity is low. However, without more detailed information about the specific usage and configuration, it is difficult to provide a more specific fix.

Recommendation

Apply workaround: Implement a retry mechanism with a backoff strategy to handle temporary disconnections or stream errors, and investigate the cause of the low remaining context capacity to prevent the compact task from failing. This approach can help mitigate the issue until a more permanent fix is available.

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