Codex Desktop remote compaction repeatedly fails on long sessions
What version of the Codex App are you using?
- Windows desktop package path:
OpenAI.Codex_26.519.5221.0_x64__2p2nqsd0c76g0 - Crashpad annotation seen in local process args:
26.519.41501 - Codex CLI/runtime:
codex-cli 0.133.0-alpha.1/windows-x86_64
What subscription do you have?
ChatGPT-authenticated Codex Desktop session. Plan not included in this redacted local report.
What platform is your computer?
Windows, Codex Desktop app.
What issue are you seeing?
Remote compaction repeatedly fails across multiple Codex Desktop threads when sessions become long-running / large-context. This makes /goal and long standing Codex workflows effectively unusable, because the thread reaches compaction and then dies instead of compacting/resuming normally.
The repeated local log error is:
compact_error=stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)
This does not appear to be a local auth/reachability issue. Running codex doctor --summary against the real user profile after cleanup reports:
13 ok · 1 idle · 0 warn · 0 fail ok
Doctor also reports auth configured, WebSocket connected with HTTP 101, and provider endpoints reachable over HTTP.
What steps can reproduce the bug?
- Use Codex Desktop on Windows with
gpt-5.5and high reasoning. - Start or resume a long-running task such as a
/goalworkflow, Git hygiene audit, or large structured extraction job. - Continue until the session reaches the remote compaction path.
- Codex POSTs to
/backend-api/codex/responses/compact. - The request connects and auth is attached, but compaction fails with
stream disconnected before completion.
Local evidence
Recent compact failures from logs_2.sqlite, redacted to thread IDs and request-size diagnostics only:
2026-05-26T08:39:15+02:00 thread=019e5f7f-2a42-7491-94b1-3a3b65c55600
last_api_response_total_tokens=237047
all_history_items_model_visible_bytes=804876
estimated_tokens_of_items_added_since_last_successful_api_response=1466
failing_compaction_request_model_visible_bytes=826350
compact_error=stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)
2026-05-26T08:36:50+02:00 thread=019e5b53-d4cc-7183-9a21-3a0544595302
last_api_response_total_tokens=234680
all_history_items_model_visible_bytes=1010829
estimated_tokens_of_items_added_since_last_successful_api_response=1428
failing_compaction_request_model_visible_bytes=1032303
compact_error=stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)
2026-05-26T08:32:34+02:00 thread=019e62df-52ae-74f3-b54f-9cb040ef6f92
last_api_response_total_tokens=235538
all_history_items_model_visible_bytes=681186
estimated_tokens_of_items_added_since_last_successful_api_response=12634
failing_compaction_request_model_visible_bytes=702660
compact_error=stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)
A detailed trace for one failure shows:
api.path="responses/compact"
auth_header_attached=true
duration_ms=67288
connected to 172.64.155.209:443
Request failed method=POST url=https://chatgpt.com/backend-api/codex/responses/compact error=error sending request
Local mitigations attempted
- Archived failed/giant local active thread rows in
state_5.sqlite. - Stopped stale per-thread
codex.exe app-server --listen stdio://workers that were reactivating failed rows. - Reduced active local session load from hundreds of millions of tracked tokens to ~26M, with no active row above 1M tokens.
- Verified no new compact errors immediately after cleanup.
- Tried enabling
remote_compaction_v2, but it caused Codex Desktop to crash on reload, so it was disabled and removed from config.
Expected behavior
Remote compaction should complete reliably for long-running Desktop sessions, or Codex should gracefully fall back / retry / trim locally instead of making /goal workflows unusable.
Additional information
This appears similar to prior stream disconnected before completion reports, but the impact here is specifically that Codex Desktop long-running /goal workflows cannot be used reliably even when local auth, websocket, and reachability checks pass.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗