OpenAI Codex CLI error
Codex CLI: Error running remote compact task: stream disconnected before...
Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)Status: Fixed in releaseLast verified 1 documented fix2 sources
What it means
Automatic or manual compaction of a long thread failed while calling the separate remote compaction endpoint. Reporters said the session became unusable afterwards.
Causes
- A contributor (2026-06-29): until recently Codex used a separate endpoint and server-side logic for compaction, which produced these "remote compaction" errors.
How to fix it
- Fix 1.
Update Codex. A contributor said they switched to a more robust approach where compaction logic is moved locally using the same endpoint as normal turns, which eliminates "remote compaction" errors. If compaction still fails, run /feedback and open a new bug report.
Slash command/feedback
More Codex CLI errors
All 14 Codex CLI errorsstream disconnected before completion: stream closed before response.completedStatus: Workaroundstream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses)Status: OpenSelected model is at capacity. Please try a different model.Status: By designYour access token could not be refreshed because your refresh token was already used. Please log out and sign in again.Status: Fixed in releaseCodex ran out of room in the model's context window. Start a new thread or clear earlier history before retrying.Status: Fixed in releaseError logging in: Port 127.0.0.1:1455 is already in useStatus: WorkaroundToken exchange failed: token endpoint returned status 403 ForbiddenStatus: WorkaroundMCP client for `playwright` failed to start: program not foundStatus: Fixed in release
Related reading
- Codex CLI 0.171: codex exec --remote, Workspace On by DefaultCodex CLI 0.171.0 adds codex exec --remote to run headless sessions on an existing app server, turns on the TUI workspace by default and picks GPT-6.2 Sol.
- Agent-Manager: A Tmux TUI for Running Claude Code, Codex, and OpenCode Side by SideAgent-Manager wraps tmux into a Go TUI that groups AI coding agents by project, shows live status for each, and lets you answer blocked agents or review their changes without attaching to their terminal.
- Codex-Maxxing: How to Run Long-Running Codex Workflows Without Losing the PlotCodex-Maxxing done right is bounded autonomy: AGENTS.md, small worktrees, explicit stop conditions and review checkpoints for long-running Codex workflows.
- Claude Fable 5 Pricing: Real Cost Per Task vs Opus 4.8, GPT-5.5 and CodexClaude Fable 5 pricing beyond the $10/$50 per MTok list rate: real cost per task versus Opus 5, Opus 4.8 and Sonnet 5, and when the premium pays off.
- Droid vs Codex (2026): Factory vs OpenAI for Terminal Coding AgentsFactory Droid vs OpenAI Codex compared on models, pricing, headless CI, multi-agent work, extensibility and openness, with a clear recommendation for each kind of developer.
- GPT-6.2 Astra and Sol: Pricing, Benchmarks and What to SwitchGPT-6.2 Astra costs $8/$40 per MTok (20% under GPT-6 Astra), Sol stays $2/$10. Vendor-reported benchmarks, cache rates, Codex setup and who should switch.
FAQ
What does "Error running remote compact task: stream disconnected before..." mean in Codex CLI?
Automatic or manual compaction of a long thread failed while calling the separate remote compaction endpoint. Reporters said the session became unusable afterwards.
How do I fix "Error running remote compact task: stream disconnected before..."?
Update Codex. A contributor said they switched to a more robust approach where compaction logic is moved locally using the same endpoint as normal turns, which eliminates "remote compaction" errors. If compaction still fails, run /feedback and open a new bug report.
Is this Codex CLI error fixed?
Status: Fixed in release. A release fixed this. The affected versions note says where the fix landed. Affected versions: Reported on codex-cli 0.114.0 (#14559) and Codex app 26.406.31014 with bundled CLI 0.119.0-alpha.11 (#17392)
Sources
Last verified against 2 sources: official docs, maintainer replies and release notes.
Newsletter
Fixes for the tools you use, weekly
One email per week. New coding agent releases, what broke, and how developers are working around it.