Skip to content

/compact and auto-compact fail with "stream disconnected before completion" since April 15, 2026 #18838

Closed as duplicate

Description

@ProydakD

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}}}

Activity

  1. added
    CLIIssues related to the Codex CLI
    contextIssues related to context management (including compaction)
    connectivityIssues involving networking or endpoint connectivity problems (disconnections)
    windows-osIssues related to Codex on Windows systems
    on Apr 21, 2026
  2. RossRichardson commented on Apr 25, 2026

    @RossRichardson

    Close, Restart OS and Run. It should fix it: #19255 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIbugSomething isn't workingconnectivityIssues involving networking or endpoint connectivity problems (disconnections)contextIssues related to context management (including compaction)windows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions