Windows Codex App: 3.76 GB paginated thread gets 502 from local /v1/responses bridge; latest-compaction slice recovers it
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What version of the Codex App are you using (From “About Codex” dialog)?
26.915.4065.0 on Windows (the locally observed Codex CLI/core version was 0.155.1).
What subscription do you have?
ChatGPT-authenticated Codex App subscription. The exact tier was not exposed by the local diagnostics used for this report.
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
A long-running Codex App thread using history_mode=paginated remained visible and readable, but every attempt to start a new turn failed after roughly two minutes with:
unexpected status 502 Bad Gateway: Unknown error,
url: http://127.0.0.1:17841/v1/responses
Three attempts failed after approximately 117–139 seconds and produced no assistant or tool output. The failures reproduced with both gpt-5.6-sol and gpt-6-astra. New and smaller threads worked, account usage limits were normal, and the repository/worktree was healthy.
The loopback endpoint was the app-managed Responses relay selected by the Codex configuration. A separately installed third-party routing application was not serving this endpoint: its Codex routing/takeover state was disabled and it used a different port.
The affected rollout was valid JSONL but extremely large:
size: 3,760,057,224 bytes
records: 369,621
history_mode: paginated
invalid JSON records: 0
The latest compacted checkpoint was near the end of the file:
latest compacted record: line 369,508
compacted record size: 386,632 bytes
replacement_history items: 13
records after checkpoint: 119
This looks related to the multi-GB rollout/resume family tracked in #25215 and #30932, but the failure boundary here is different: the paginated thread can be listed/read, while turn/start eventually receives a 502 from the local Responses relay.
What steps can reproduce the bug?
The exact multi-GB history takes time to build, but the observed reproduction shape was:
- Create and use a Codex App thread for a long-running coding project.
- Continue it through many turns, tool calls, and context compactions until the local rollout JSONL grows to multiple gigabytes.
- Reopen/resume the thread. Its recent history remains visible and readable.
- Submit a small new user message.
- Wait about two minutes.
- The turn fails with
502 Bad Gatewayfrom the app-managed loopback/v1/responsesendpoint, with no assistant output. - Repeat with another supported model; the same thread fails while small control threads continue to work.
A causality/recovery test succeeded after preserving the full original rollout as a backup and replacing only the active copy with:
- the original first
session_metarecord; - the latest valid
compactedcheckpoint; - every record after that checkpoint.
The reduced active rollout was:
size: 919,001 bytes
records: 135
invalid JSON records: 0
After unarchiving/resuming the same thread, a diagnostic turn using gpt-5.6-sol completed successfully in 32.813 seconds through the same local Responses path. After that successful turn, the rollout grew normally to about 3.9 MB / 182 records.
No raw rollout content was changed inside the retained records. The full 3.76 GB source was kept separately before the active copy was reduced.
What is the expected behavior?
- Starting a turn in a paginated thread should use the latest valid compaction state and suffix without loading, replaying, or forwarding superseded pre-checkpoint history.
- Persisted rollout size should be bounded, rotated, or archived after a successful compaction while keeping a full audit/export copy if desired.
- If a rollout is too large, the app should show an actionable per-thread error instead of surfacing an opaque 502 from a loopback endpoint.
- Codex should offer a built-in, validated recovery action equivalent to “back up full rollout, then continue from latest compaction checkpoint + suffix.”
Additional information
The recovery strongly correlates the failure with obsolete pre-latest-compaction data in the active rollout: only the active rollout shape changed, while the thread identity, repository, account, model provider, app configuration, and local Responses route remained the same.
Related reports:
- #25215 — multi-GB rollouts become unrecoverable in resume/list paths
- #30932 — huge rollout dominated by compacted records; latest-checkpoint recovery
- #29531 — duplicated history causing multi-GB growth
The raw rollout cannot be uploaded because it contains private conversation, tool output, and project data. All identifiers, usernames, paths, repository names, and message contents are intentionally omitted.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how paginated thread resume and turn/start reach the local /v1/responses relay, especially around the latest compacted checkpoint and suffix. Compare behavior for the 3.76 GB rollout and the reduced 919 KB rollout; done means large histories avoid obsolete pre-checkpoint data or provide an actionable recovery error instead of an opaque 502.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, cli
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100