Skip to content

automatic triggered "remote compact task" never works (Error running remote compact task: stream disconnected before completion) #20160

Closed

Description

@Kupferfox

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

Activity

  1. changed the title [-]remote compact task never works (Error running remote compact task: stream disconnected before completion)[/-] [+]automatic triggered remote compact task never works (Error running remote compact task: stream disconnected before completion)[/+] on Apr 29, 2026
  2. added
    CLIIssues related to the Codex CLI
    windows-osIssues related to Codex on Windows systems
    contextIssues related to context management (including compaction)
    connectivityIssues involving networking or endpoint connectivity problems (disconnections)
    on Apr 29, 2026
  3. changed the title [-]automatic triggered remote compact task never works (Error running remote compact task: stream disconnected before completion)[/-] [+]automatic triggered "remote compact task" never works (Error running remote compact task: stream disconnected before completion)[/+] on Apr 29, 2026
  4. matthewromano18-code commented on Apr 29, 2026

    @matthewromano18-code

    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

  5. codec-d commented on Apr 29, 2026

    @codec-d
    Image
  6. presidenzo commented on May 7, 2026

    @presidenzo

    Also seeing this on Codex Desktop for macOS.

    Thread ID: 019e0390-d329-74c3-b8ab-13a32d339c9b
    Codex App: 26.429.61741 (2429)
    Error:

    Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)
    

    This is still happening today (2026-05-07).

  7. etraut-openai commented on Jun 29, 2026

    @etraut-openai
    Contributor

    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.

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