codex - 💡(How to fix) Fix Compaction/reconnect can drop live orchestration state after stream disconnect

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…

In the Codex desktop/app experience, a failed remote compaction appears to drop live orchestration state after reconnect, even though the local filesystem and GitHub state remain intact.

This may belong to the app/backend rather than the CLI itself; filing here because this is the public Codex issue tracker I could find. Please route or close if there is a better tracker.

Error Message

Error running remote compact task: stream disconnected before completion: error sending request for url (.../backend-api/codex/responses/compact)

Root Cause

This may belong to the app/backend rather than the CLI itself; filing here because this is the public Codex issue tracker I could find. Please route or close if there is a better tracker.

Fix Action

Fix / Workaround

Workaround Used

Code Example

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

Summary

In the Codex desktop/app experience, a failed remote compaction appears to drop live orchestration state after reconnect, even though the local filesystem and GitHub state remain intact.

This may belong to the app/backend rather than the CLI itself; filing here because this is the public Codex issue tracker I could find. Please route or close if there is a better tracker.

What Happened

During a long-running Codex session with multiple worktrees and PR validation/publish work in progress, the UI reported a compaction failure similar to:

Error running remote compact task: stream disconnected before completion: error sending request for url (.../backend-api/codex/responses/compact)

After reconnect/compaction recovery:

  • The local repo/worktree state was still recoverable.
  • GitHub PR state was still correct.
  • The active thread lost live orchestration context, including handles for reviewer sub-agents that had been running before the reconnect.
  • The assistant had to reconstruct state from disk, git status, worktrees, PR metadata, and the visible transcript instead of continuing from the compacted thread state.

Expected Behavior

If compaction fails or the response stream disconnects, Codex should either:

  • retry compaction without losing live state, or
  • preserve enough resumable state to reconnect to existing sub-agents / active tasks, or
  • clearly report that live agent handles were lost and that recovery must happen from external artifacts.

Actual Behavior

The session resumed with enough transcript to continue manually, but not enough live orchestration state to know whether previously spawned review agents still existed or could be queried. The safe recovery path was to re-check GitHub/worktree state and re-spawn read-only reviewers rather than trust the compacted context.

Impact

This is risky for long-running coding/orchestration sessions because compaction can happen exactly while validations, PR updates, or independent reviews are running. The durable artifacts survive, but the live agent/session graph becomes unreliable.

Workaround Used

I recovered by treating the thread as untrusted and reconstructing from durable state:

  • git status in each worktree
  • gh pr view for PR head/merge state
  • local diffs and commits
  • PR comments and validation output

That worked, but it is manual and easy to get wrong under time pressure.

Environment

  • Product surface: Codex desktop/app session
  • Date observed: 2026-05-08 UTC
  • Local repo work involved Git worktrees and GitHub PRs
  • The failure was observed during automatic context compaction/reconnect, not during a local shell command

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…

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 Compaction/reconnect can drop live orchestration state after stream disconnect