Codex App reports “Context compacted” after remote compaction failed, then remains stuck reconnecting

Open 💬 6 comments Opened Aug 16, 2026 by alchemistklk
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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

26.810.52044 (6662)

Bundled app-server/CLI observed in the affected run: 0.147.0-alpha.6.5

What subscription do you have?

ChatGPT subscription (exact tier is not shown in the app UI)

What platform is your computer?

Darwin 27.0.0 arm64 arm

What issue are you seeing?

A long-running Codex Desktop image-generation task became stuck during remote compaction. The thread had accumulated many rounds of image generation and image-related inputs/outputs over time. The compaction request failed, but the UI still displayed “Context compacted”, followed by “Reconnecting 2/2”. The task did not reach a truthful terminal state and had to be stopped manually.

This workload type may be relevant because repeated image-generation turns can make the persisted rollout and compacted history much larger than a text-only task.

Sanitized local log timeline (2026-08-16, Asia/Shanghai):

  • thread/compact/start at 17:48:05.
  • The request body was 43,810,885 bytes before compression and 32,302,356 bytes after zstd.
  • The initial POST returned HTTP 200 after about 6m17s, but the response stream then failed with:

stream disconnected before completion: Transport error: network error: error decoding response body

  • The retry failed with:

Connection failed: error sending request

  • The compact task remained running until manually interrupted after about 10 minutes.
  • No successful compaction record was written, despite the UI saying “Context compacted”.
  • After restarting the app and resuming, the thread hit five WebSocket retries with:

failed to send websocket request: IO error: Broken pipe (os error 32)

  • The UI also showed “You stopped after 0s” for a turn that actually lasted about 63 seconds.

The affected rollout JSONL is approximately 753 MB. Local SQLite integrity checks for the Codex state/log databases all returned ok. This does not appear to be local database corruption.

What steps can reproduce the bug?

  1. Use a Codex Desktop image-generation task over a long period, with repeated generated images/image inputs, many turns, and repeated context compactions.
  2. Let the rollout/session file grow very large (the affected one was ~753 MB).
  3. Trigger automatic or manual compaction when the active serialized request is tens of MB.
  4. Observe the compaction request run for several minutes and then fail while decoding the response body.
  5. Observe that Desktop can still display “Context compacted” and enter a reconnect loop instead of recording a failed terminal state.
  6. Restart Desktop and resume the same task; repeated WebSocket Broken pipe retries may occur.

Affected thread ID: 019ff9a4-3eb6-7012-ab6d-81d274068f87

Compact turn ID: 01a009f8-a488-7232-bd7f-d3be7a799918

The raw rollout and logs are not attached because they contain private prompts, tool output, local paths, and creative-project content.

What is the expected behavior?

  • Very large compaction inputs should be pruned/chunked, or rejected quickly with a specific size-related error.
  • A failed compaction must not be shown as successfully compacted.
  • The compact task should reach a terminal failure state without requiring manual interruption.
  • Restart/resume should provide a clear recovery path instead of repeated transport retries.
  • UI duration should reflect the actual turn duration.

Additional information

Related reports appear to cover parts of the failure, including #24550, #31375, #36059, and #36232. This report adds a measured macOS failure timeline plus the incorrect success state shown by the Desktop UI.

Network note: a TUN/VPN client was active, while macOS HTTP/HTTPS/SOCKS proxy settings were disabled. This may contribute to transport instability, but it does not explain the false “Context compacted” UI state or the missing compaction terminal record.

View original on GitHub ↗

6 Comments

github-actions[bot] contributor · 12 days ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #38434

Powered by Codex Action

etraut-openai contributor · 11 days ago

The Codex harness no longer uses remote compaction — it hasn't for a couple of months. So I'm confused about why you're seeing this with the recent CLI. I suspect that you aren't actually doing a remote compaction (using the old remote/compact endpoint) but are running into a different issue with the local compaction process. Please use /feedback and post your session ID here.

shleder · 11 days ago

Thanks for the detailed timeline. If useful, codex-rescue==0.1.0a4 is a local-first diagnostic tool for persisted Codex sessions. It does not repair compaction, transport, or Desktop state, but a read-only doctor pass may help distinguish persisted rollout/compaction evidence from an app or network-only failure:

codex-rescue doctor --json "/path/to/the-affected-rollout.jsonl"

Please share only a sanitized summary of the status, findings, and aggregate counts. Do not upload the raw rollout/session database, prompts, tool output, credentials, or private paths. The command reads the rollout without modifying it and reports whether the persisted history contains recognizable structural or compaction-state evidence.

jks-liu · 10 days ago

My guess is normal message is stream, but compact is not, which cause your proxy timeout.

fakerms · 10 days ago
@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/compact failures 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 against chatgpt.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 explain stream disconnected before completion during 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 completion reports by separating network-path idle cutoff from remote compact service/client failures.

https://github.com/openai/codex/issues/22107#issuecomment-4458051584

shleder · 1 day ago

Adding one field observation to the proxy-timeout theory above: after a failed remote compact the local rollout remained complete in my case, so recovery tooling that reads only JSONL still sees a healthy thread. vetto rescue diagnose <file> verifies that quickly if anyone needs certainty before the reconnect fix ships.