/compact and auto-compact fail with "stream disconnected before completion" since April 15, 2026
What version of Codex CLI is running?
0.122.0
What subscription do you have?
PRO
Which model were you using?
gpt-5.4
What platform is your computer?
Microsoft Windows NT 10.0.22631.0 x64
What terminal emulator and version are you using (if applicable)?
PowerShell
What issue are you seeing?
Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)
What steps can reproduce the bug?
/compact
compact starts normally
after about 3-10 minutes, the task fails
the turn completes without any compacted result
repeated attempts behave the same way
What is the expected behavior?
/compact and auto-compact should complete successfully and return a compacted conversation/context.
Additional information
Since April 15, 2026, compacting stopped working in Codex CLI.
The issue happens in both cases:
when /compact is triggered manually
when compact is triggered automatically by the model
Every retry ends with the exact same error:
Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)
This looks reproducible and not random.
Relevant logs
{"timestamp":"2026-04-21T13:03:03.024Z","type":"event_msg","payload":{"type":"task_started","turn_id":"019db023-176e-7c20-b0f2-e06dd50450eb","started_at":1776776583,"model_context_window":258400,"collaboration_mode_kind":"default"}}
{"timestamp":"2026-04-21T13:13:03.358Z","type":"event_msg","payload":{"type":"error","message":"Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)","codex_error_info":"other"}}
{"timestamp":"2026-04-21T13:13:03.359Z","type":"event_msg","payload":{"type":"task_complete","turn_id":"019db023-176e-7c20-b0f2-e06dd50450eb","last_agent_message":null,"completed_at":1776777183,"duration_ms":600334}}}This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗