Keep running into "Error running remote compact task"

Resolved 💬 6 comments Opened May 16, 2026 by tbvl Closed Jun 29, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

0.130.0

What subscription do you have?

Pro plan 5x

Which model were you using?

gpt-5.5 xhigh

What platform is your computer?

Darwin 25.3.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

iTerm2 + TMUX

Codex doctor report

not available

What issue are you seeing?

All day I have experienced longer running sessions ending mid session with "■ Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)". Only remedy is to restart codex and start over, cant resume session.

What steps can reproduce the bug?

Uploaded thread: 019e30c3-ffd7-7e43-b945-47a5b2d73ea6

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

6 Comments

github-actions[bot] contributor · 2 months ago

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

  • #22793
  • #21643
  • #22798
  • #23003

Powered by Codex Action

wifiuk · 2 months ago

<img width="1236" height="166" alt="Image" src="https://github.com/user-attachments/assets/7f770d8d-d022-49f7-9fd7-7558d2cd1fc1" />

i get this every single time it tries to do an automated compact, then it dies and nothing works, have to restart sessions fresh which is super frustrating.

WolfgangSenff · 2 months ago

I've been getting this every time as well. It happens also when I do /compact manually.

Necmttn · 29 days ago

Compaction should be a resumable operation with its own attempt record.

Before calling the remote compact endpoint, persist compact_attempt_id, source turn range, source hash, previous context pointer, and status started. If the stream disconnects, resume can either retry that attempt or keep using the pre-compact context, instead of leaving the whole session unrecoverable.

That turns compact failure into a bounded state.

---

_Generated with ax._

etraut-openai contributor · 21 days ago

Thanks for reporting this problem. Until recently, Codex used a separate endpoint and server-side logic for compaction. We recently switched to a more robust approach where the compaction logic is moved locally using the same endpoint as normal turns. This eliminates "remote compaction" errors and increases the stability and reliability of compaction operations. If you see further problems with compaction, please use /feedback and open a new bug report.