codex - 💡(How to fix) Fix Codex Desktop GPT-5.5 remote compaction fails and leaves thread unusable [5 comments, 6 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#19558Fetched 2026-04-26 05:15:04
View on GitHub
Comments
5
Participants
6
Timeline
15
Reactions
2
Author
Timeline (top)
commented ×5labeled ×5cross-referenced ×3unlabeled ×2

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.

Error Message

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.

Root Cause

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.

Code Example

Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)
RAW_BUFFERClick to expand / collapse

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

  1. Use Codex Desktop with GPT-5.5.
  2. Work in a long-running thread until context usage is above about 90%.
  3. Let Codex trigger automatic remote context compaction.
  4. Wait for the compact request to run.
  5. The request fails with stream disconnected before completion for https://chatgpt.com/backend-api/codex/responses/compact.
  6. Try to send another instruction in the same thread.
  7. 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.

extent analysis

TL;DR

Implement retry logic with backoff for failed remote compact requests to prevent thread failure.

Guidance

  • Verify the current timeout setting for the /backend-api/codex/responses/compact endpoint and consider increasing it to accommodate larger compaction requests from GPT-5.5.
  • Add a retry mechanism with exponential backoff to handle temporary stream disconnections and prevent thread failure.
  • Surface a recovery action to the user when compaction fails, allowing them to manually recover or retry compaction without abandoning the thread.
  • Consider adding manual compact controls to give users more flexibility before the automatic threshold is reached.

Example

No code example is provided due to the lack of specific implementation details, but a potential approach could involve using a retry library or implementing a custom retry mechanism with backoff.

Notes

The suggested fix direction provided in the issue is a good starting point, and implementing retry logic with backoff should help mitigate the issue. However, further investigation into the root cause of the stream disconnections and the feasibility of increasing the timeout may be necessary.

Recommendation

Apply a workaround by implementing retry logic with backoff for failed remote compact requests, as this is likely to provide the most immediate relief from the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

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.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Codex Desktop GPT-5.5 remote compaction fails and leaves thread unusable [5 comments, 6 participants]