Error running remote compact task: stream disconnected before completion
Resolved 💬 62 comments Opened Jan 20, 2026 by loop-uh Closed Mar 27, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
codex-cli 0.87.0
What subscription do you have?
max
Which model were you using?
_No response_
What platform is your computer?
_No response_
What terminal emulator and version are you using (if applicable)?
_No response_
What issue are you seeing?
<img width="1865" height="66" alt="Image" src="https://github.com/user-attachments/assets/588ac161-136c-41dd-a435-db842711b42a" />
What steps can reproduce the bug?
Uploaded thread: 019bdc79-8188-7831-89c9-10668bd4716c
What is the expected behavior?
_No response_
Additional information
_No response_
62 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Thanks for the bug report. The logs that you attempted to upload unfortunately didn't come through. Do you have that session around still? If so, could you resume it and retry the
/feedbackcommand? Much appreciated!<img width="801" height="129" alt="Image" src="https://github.com/user-attachments/assets/375608d8-17d3-4ca5-bb1b-61ab359a415d" />
how i can post it?
https://github.com/openai/codex/issues/new?template=2-bug-report.yml&steps=Uploaded%20thread:%20019bdc72-fc23-7782-a1d6-8b1dff4db740
I get this all the time, particularly during certain hours of the day or if the session contains screenshots. One instance: 019c1105-6702-7690-8970-b08aae6dd5d7
try the command
I also have the same error. When I use subagent to complete the task, the context is too long, and the automatic resume will report an error. When I try to enter information or manually resume, it will also report an error. There is no way to continue this conversation at present.
Here is instance: 019cfbac-5a9b-7a12-89e9-7467da5d4cce
me too
me too,I restarted and tried again, but it still didn't work. Then I changed the setting from ultra-high to high and tried again, and it worked.
Me too. I’m consistently getting this error during large code analysis tasks (~40k+ lines):
Error running remote compact task: stream disconnected before completion
It usually happens when Codex tries to compact context in long sessions. After that, execution often breaks or becomes unstable. Seems related to large context size or timeout in the /compact endpoint. Is this a known limitation?
Getting this as well, on a long conversation.
Me too! How to save my conversation?
Getting the same issue
``
Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)``If you use codex desktop, try to fork the session/conversation and tell LLM to continue. Works for me.
this is so annoying
This issue is still happening,codex cli version 0.116.0
I investigated this and have a concrete root-cause hypothesis plus a proposed fix.
Root cause appears to be two separate issues in the remote compact path:
/responses/compactis a unary POST, but transport failures on that endpoint currently get funneled throughCodexErr::Stream(...), which makes the user-facing error misleading:stream disconnected before completion: ...https://chatgpt.com/backend-api/codex/responses/compact/responses/compactwas not using request compression, even though normal/responsesrequests already can. On large compact payloads, that makes transport failures more likely.Proposed fix:
/responses/compact/responsescompact request failed: ...instead of:
stream disconnected before completion: .../responsesbehavior stays unchangedSuggested regression coverage:
content-encoding: zstdwhen enabledIf this approach aligns with the intended fix, I can open a PR once invited under the repo’s contribution policy.
If external PR invitation is not possible, this looks like a small, self-contained fix in shared
codex-api/codex-corecode, and likely straightforward for the Codex team to land directly.@etraut-openai
Relevant logs were attached:
This happens to me just as frequently—it’s really frustrating. My long-running background tasks get interrupted and are very difficult to resume.
Codex (v0.116.0)
I had the same issue. But I found a workaround that successfully saved one of my sessions: temporarily switch to GPT-4 mini (low reasoning) and trigger the compact task, then switch back to GPT-4 after the compaction is complete.
Consolidating this issue onto #14860.
try this skill, https://github.com/haibindev/golast, It recovers the last actionable request from a crashed or compacted session, so you can pick up exactly where you left off.
me too
019d4ab1-0351-71a0-ba05-ec95238f5cb6
same issue here. I don't understand why this kinda serious problem can exist for this long time.
Same issue here. But for me, I have proxy configured in
~/.codex/config.toml. The conversation continue normally until the context compaction when it spit out the following error message:Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)
Problem still alive. I have it already 2 months...
really really serious problem, need more focus…
I have a recovery method with a success rate above 90%: temporarily switch to 5.4 mini, then send a message to trigger automatic compaction. Do not use the compact command directly, because it will still most likely fail. Once the compaction is finished, switch back to the original model.
man up man
it works
This situation happens to me quite often. It’s most likely caused by sudden network fluctuations and an excessively long context, which leads to a bug. You can switch to a lower model—for example, if you’re currently using 5.4, switch to 5.3 or an even lower version. Then just send any message, and it will prompt that the context is being compressed. After that, the conversation will return to normal. Don’t bother trying to change your network proxy or anything like that—it’s pointless. I’ve already tried.
It works.
Still existing.
exactly this question...
this is suppose to be the highest priority bug for them.
I literally has been hitting the problem with compaction for the last 2 days non-stop, every second compaction it seems just hangs and fails!
By the way, just adding a bit more info here:
GPT-5.2 works normally and doesn’t show that error message. GPT-5.4, however, always pops it up.
Uploaded one: 019dbde4-4ab8-73a2-843e-c467a5644989
still exist
still exist. It really interupt the automation.
seeing this as well frequently, happening more on gpt 5.5
It is completely impossible to carry out the long conversation task. Now, when it runs halfway, it will report an error: "Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)". When will this be fixed?
<img width="830" height="541" alt="Image" src="https://github.com/user-attachments/assets/56046a50-8d61-4fa9-a4ca-3da2506cb957" />
<img width="884" height="627" alt="Image" src="https://github.com/user-attachments/assets/3868e0e7-3634-4729-b181-1cd71c2bdf0d" />
This error has seriously affected my usage experience. I am unable to develop my Unity project.
Only this solution works for me. Thank you!
glad it helps
800 billion valuation and they cant address this?
Same here. Can't find a workaround. Happens more for me in Xhigh.
Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)
I'm getting tired of this shit !!
<img width="749" height="200" alt="Image" src="https://github.com/user-attachments/assets/4af179f3-2373-4601-a2f6-3a75088e252a" />
Very frequently!!!!
Any fix for this? It's happening constantly for me today.
yep i also got it
For complex projects requiring prolonged, independent coding, this issue is simply a disaster. No one wants to spend hours repeatedly trying to recover from errors.
Still have this problem, already 4 months. Because of that I have to use Claude Code max instead of codex Pro x20....
Every my chat has this problem.
Same issue.
019cd581-6886-7c72-aaba-0ddcfc3627a2
It's a serious problem man. Spend more time than it really work for lol
same issue!!! fix it!!! bro i paid 100 per month and i am not able to use codex
This problem is ultra urgent. Please fix and have roubst regression testing to fix compacting issues. There shuold NEVER be a reason for compaction to fail and for me to loose an entire session i cant recover on.. This breaks the entire work flow multiple times a day. Insane.
Hi,
This has been going on for a very long time. It is a major problem. Very disruptive to the workflow. If this problem can be fixed soon, Codex will be much better. I am surprised this is still happening as I have seen multiple updates and it persists.
same issue ffs!
same issue ffs!
遇到了相同的问题,希望codex解决
I turned off my vpn. That seemed to solve the issue up til now at least
same
Why does this problem persist? Whenever I use GPT-5.5 for long-context tasks, I consistently encounter this bug.
I then have to switch to GPT-5.4 Mini to perform a context compaction before switching back to GPT-5.5.
Is your team aware of this issue, and are there any plans to address it?