Codex Desktop GPT-5.5 remote compaction fails and leaves thread unusable
Summary
Codex Desktop repeatedly fails during automatic remote context compaction after switching to GPT-5.5. Once this happens, the current thread becomes unusable and every later instruction fails, so the only practical recovery is to start a new thread.
Environment
- Product: Codex Desktop
- Model: GPT-5.5
- Auth mode: ChatGPT account
- Platform: macOS
- Date observed: 2026-04-25
- Subscription: Plus
- Codex app version: 26.423.10653
Actual behavior
When the thread context usage grows above roughly 90%, Codex automatically starts context compaction. After waiting for a long time, it fails with:
Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)
After this error, the current conversation can no longer execute any further instructions. The thread appears stuck in a failed compact / pre-sampling state.
Expected behavior
When automatic context compaction is required, Codex should either:
- complete the compaction successfully, or
- fail gracefully and allow the current thread to continue, retry compaction, or recover without forcing the user to abandon the thread.
Reproduction pattern
- Use Codex Desktop with GPT-5.5.
- Work in a long-running thread until context usage is above about 90%.
- Let Codex trigger automatic remote context compaction.
- Wait for the compact request to run.
- The request fails with
stream disconnected before completionforhttps://chatgpt.com/backend-api/codex/responses/compact. - Try to send another instruction in the same thread.
- The thread remains unusable.
Notes
This looks similar to existing remote compaction failures, but it became much more frequent after the GPT-5.5 update. My guess is that GPT-5.5 long-context sessions generate larger or heavier compaction requests, making the remote compact path more likely to hit a timeout or stream disconnect. The bigger issue is that the failed compact leaves the thread unrecoverable.
Impact
This is high impact for long-running coding tasks because it tends to happen after substantial work has accumulated in the thread. When it fails, the user loses the active working context and has to manually recover from files, git diff, or handoff notes in a new thread.
Suggested fix direction
- Add retry / backoff for failed remote compact requests.
- If compaction fails, keep the thread usable and surface a recovery action instead of leaving it stuck.
- Consider exposing manual compact / handoff controls before the automatic threshold.
- Check whether there is a fixed timeout around
/backend-api/codex/responses/compact, especially if failures cluster around a consistent duration.
24 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Same for me since week and they still didnt fix https://github.com/openai/codex/issues/17928
Wow!!! Exactly what happen to me, the fricking thread got auto compacted, then model start to to repeat itself without the correct context
Got this problem too. started today
Same problem here.
<img width="464" height="77" alt="Image" src="https://github.com/user-attachments/assets/6dfb00e4-d5da-4ac1-b887-c5ee6f2a6df1" />
<img width="1053" height="292" alt="Image" src="https://github.com/user-attachments/assets/9fbbe059-f920-4712-abf8-89ff5d4e9629" />
Same problem
I'm having this problem for 2 days now, literally compaction never works anymore 🥀
So, I was running into the same problem, and though it had to do with a VPN or network configuration. I tried multiple different solutions, including the increasing of time from idle time and the rewq in timeout to something like 15 minutes.
(I am running codex in a windows, linux, and mac via codex app, and in all 3 of them I was facing the same problem, in my dorms, faculty internet, and cellular network)
What seemed to happened is that it always cuts out after 5m01s so, I found it strange, tried to clone the codex repo and all that.
After trying some more things.
I found a comment saying that changing the model provider from OpenAI to something else might work
'''
model = "gpt-5.5"
model_provider = "openai-local-compact"
model_reasoning_effort = "high"
model_auto_compact_token_limit = 233000
personality = "pragmatic"
approval_policy = "never"
sandbox_mode = "danger-full-access"
plan_mode_reasoning_effort = "xhigh"
[model_providers.openai-local-compact]
name = "OpenAI Local Compact"
wire_api = "responses"
requires_openai_auth = true
supports_websockets = true
stream_idle_timeout_ms = 900000
'''
So, I resumed around 5 sessions without this first, tried compacting a few times, and it didn't worked.
And then resumed the sessions and tried compacting again, with this workaround, and in less than 10 seconds the compact was working. (Only downside is I can't see the previous codex history with the resume command, or in the app history, as it's model provider filtered)
Right now I am trying in some long running tasks that previously failed, and checking if this is a good workaround for the time being, and so far it seems it works, and no major issues, will try to have something running for around 5-15 hours to confirm.
So, actually the model provider is not a real provider, but since codex doesn't detect it as OpenAI. then it fallbacks from responses/compact to a normal request for the summarization.
What my Codex says is the following:
----
The main issue, #14559, is still open and labeled bug + context, which means it is tracked as a compaction/context problem: https://github.com/openai/codex/issues/14559
https://github.com/openai/codex/issues/19400
Why avoiding the compact server works:
OpenAI’s own Codex architecture writeup says Codex normally uses a special /responses/compact endpoint for compaction. That endpoint returns a compacted history, including an opaque type=compaction item, and Codex uses it automatically when the compact limit is exceeded: https://openai.com/index/unrolling-the-codex-agent-loop/
Our workaround changes this decision. Codex’s local code enables remote compaction when the provider name is exactly OpenAI or Azure-like. By naming the custom provider OpenAI Local Compact, it still uses OpenAI auth and normal Responses/WebSocket calls, but it no longer matches the “use remote compact endpoint” predicate.
So compaction changes from: chatgpt.com/backend-api/codex/responses/compact
to the older/local strategy: normal Responses request that summarizes/compacts history
That works because your normal Responses path is healthy, while the special compact endpoint is the thing timing out/failing. It is not magic; it just routes around the brittle endpoint.
it is still doing real compaction in the practical sense: it replaces the live conversation history with a shorter compacted history and recomputes token usage.
What changes with openai-local-compact is only which compaction mechanism is used:
The local path still does this:
Relevant code:
So: yes, it compacts. It just does not use OpenAI’s special server-side compact endpoint that can return opaque type=compaction items. It uses a normal model-generated summary as the replacement history instead.
----
tldr;
In the code, remote compaction is enabled only when: provider.is_openai() || is_azure_responses_provider(...) and is_openai() is literally: self.name == "OpenAI" if it's not then Codex selects the normal compaction path instead of calling /responses/compact
I think this is just a TEMPORARY workaround, but probably OpenAI team is already investigating this more in depth, they are great at fixing issues faced by the community.
Hi Codex team — could you clarify whether this GPT-5.5 Desktop remote compaction failure is being tracked under this issue, #14559, #19400, or another internal tracker?
There seem to be several related compaction threads:
stream disconnected before completionfor/codex/responses/compactgpt-5.5appears to be sent directly to/responses/compact, which may not support it reliablytools.defer_loading requires tools.tool_searchcompaction payload issueFor users, the practical impact is still severe: once auto-compaction fails, the current Desktop thread can become unusable and long-running GPT-5.5 sessions are risky.
A short status update would help a lot: is this considered fixed by #19771, still pending a release, a separate
/responses/compactbackend issue, or something that should be consolidated into #14559/#19400? Thanks!Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)
All day today on every session requiring compaction.
Additional report for the compaction-specific failure:
The user reports that this is not a proxy issue. Their earlier reconnect / retry problem has been resolved, but remote context compaction still frequently fails after running for a long time.
Error shown:
Observed behavior:
Expected behavior:
/backend-api/codex/responses/compact, it would help to document it or expose a way to tune/retry it.This seems aligned with this issue's core problem: compaction/autocompaction failure after long-running context accumulation, independent of proxy configuration.
I get the same problem in EVERY thread now. I am almost unable to complete tasks. It can happen as soon as the first compaction.
Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)
GPT5.5
Codex Desktop latest update
Thread ID 019dc54d-4fe7-7f12-a99c-678425fc5aee.
No VPN.
Additional current reproduction after updating to the latest Codex:
The user updated from
0.125.0to0.128.0, but automatic context compaction still fails in the same way. Local logs show the compact request is still routed through the remote compact endpoint and fails after about 60 seconds:Immediately after that, the log contains:
This appears to still be reproducible on the latest public npm package, so upgrading alone does not resolve it.
One useful detail: normal Responses/WebSocket requests with
gpt-5.5continue to work in the same environment; the failure is specific to the remote compaction path.Adding one more current Desktop reproduction with local log evidence.
Environment from logs:
What happened:
Skracanie kontekstu/ context shortening).Relevant local log lines:
So this looks like two related problems:
I am adding this here rather than opening a new issue because it appears to be the same failure family as the reports above.
+1 on macOS, with two new data points beyond the OP.
Environment
gpt-5.5,model_reasoning_effort = "xhigh"Verbatim error (auto-compact path):
New info beyond the OP:
/compactalso fails the same way after the auto-compact failure. So this isn't only an auto-trigger problem — once the thread is in this state, the user has no recovery path inside the session. Same endpoint, same disconnect.model_auto_compact_token_limit = 200000workaround does not prevent the unrecoverable state — it just delays which turn trips it. Once compact fires, success or unrecoverable is binary.Pro-tier ask (cross-ref #19464): GPT-5.5 ships with 1M tokens at the API per OpenAI's launch notes. The 272K Codex cap means Pro users hit
/responses/compactconstantly — and when it disconnects, the session is gone. Pro is paid headroom; please make 1M an opt-in for Pro/Team, even with a higher usage multiplier (the model already supports it, this is purely a Codex-side cap).The acute fix is making
/responses/compactreliable forgpt-5.5payloads (see also #19400 — endpoint may not fully accept thegpt-5.5slug) and keeping the thread usable when it doesn't.I will note, it works when I disable my VPN 🥀
Also seeing this on Codex Desktop for macOS.
Thread ID:
019e0390-d329-74c3-b8ab-13a32d339c9bCodex App:
26.429.61741 (2429)Error:
This is still happening today (2026-05-07).
I’m seeing the same failure on a newer Codex Desktop build, with repeated remote compaction failures near the context limit.
Environment:
Key redacted log evidence:
Behavior:
The thread gets close to the model context limit, auto compact starts, the /responses/compact request runs for about 60 seconds, then disconnects before completion. The thread is left effectively unusable because later turns keep hitting the failed compact path.
This does not look repo-specific. It looks like the remote compaction path either needs chunking, a longer deadline, better retry behavior, or a recovery path that lets the user continue from a summarized/new thread state.
I’ve redacted account/email fields from the logs.
Changing auto compact token limit in config to a smaller value seems to help.
@etraut-openai looping you in because you previously commented in #14860 that increasing timeouts may paper over an underlying latency issue.
I opened a focused diagnostic issue here: #22798
The goal is not to claim that all
/responses/compactfailures are caused by the user's network. It is to give users a concrete way to test one specific failure class: whether the same network/proxy/VPN/gateway path used by Codex can keep a long-idle HTTPS request alive for more than 90 seconds.The proposed self-test uses
slee.pt, which intentionally waits before replying. This is different from a basic connectivity check againstchatgpt.com, because the failure mode here is about surviving a long silent wait, not just DNS/TLS/connectivity.If
slee.pt>90s is cut off early on the same path used by Codex, that user has evidence of a transport-path idle cutoff that can directly explainstream disconnected before completionduring remote compaction. If it succeeds, that specific explanation becomes less likely and the report can focus more on backend/client compaction behavior.This may help triage the many duplicate
stream disconnected before completionreports by separating network-path idle cutoff from remote compact service/client failures.I have had the same issue for a few weeks as well. However, for me it seems to happen consistently. I now have to use a workaround where I get Codex to keep a per-task journal so that I can get it to pick up where it left off in a fresh session by referring to the journal due to the consistent context compaction issue.
Thanks for reporting this problem. Until recently, Codex used a separate endpoint and server-side logic for compaction. We recently switched to a more robust approach where the compaction logic is moved locally using the same endpoint as normal turns. This eliminates "remote compaction" errors and increases the stability and reliability of compaction operations. If you see further problems with compaction, please use
/feedbackand open a new bug report.When will this issue be fixed in the release? It has seriously affected my work efficiency