automatic triggered "remote compact task" never works (Error running remote compact task: stream disconnected before completion)
Resolved 💬 5 comments Opened Apr 29, 2026 by Kupferfox 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?
codex-cli 0.125.0
What subscription do you have?
Pro
Which model were you using?
gpt-5.4, gpt-5.5
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What terminal emulator and version are you using (if applicable)?
Powershell/CMD/VSCode (no difference)
What issue are you seeing?
On an automatic compact, the process fails. A manual "/compact" afterwards fails too. No chance to get the session running again.
Error message: Error running remote compact task: stream disconnected before completion: error sending request for url
(https://chatgpt.com/backend-api/codex/responses/compact)
The direct internet connection is stable and has no influence on this behaviour.
A manual "/compact" before the context-window is reached _occasionally_ works.
What steps can reproduce the bug?
Fill session up till the context window limit is reached. The automatic compact-task and following manual /compact then fails.
What is the expected behavior?
That the compact works...
Additional information
_No response_
5 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Thank God, I’m not the only one. This is the most irritating thing ever I don’t understand why it’s happening. I lowered my automatic compacting window to 150,000 tokens and it’s still doing it. I don’t know what the issue is
<img width="973" height="616" alt="Image" src="https://github.com/user-attachments/assets/e029f757-af7e-4a52-b250-b7aae3dae40e" />
Also seeing this on Codex Desktop for macOS.
Thread ID:
019e0390-d329-74c3-b8ab-13a32d339c9bCodex App:
26.429.61741 (2429)Error:
This is still happening today (2026-05-07).
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
/feedbackand open a new bug report.