Skip to content

Compaction failure #20931

Closed
Closed

Description

@BottyBott

What version of Codex CLI is running?

0.128.0

What subscription do you have?

PRO

Which model were you using?

5.5 xhigh

What platform is your computer?

Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64

What terminal emulator and version are you using (if applicable)?

VSCode

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)
Compaction almost never works, leaves session hung and ends current conversations. When I keep telling it to proceed in order to restart compaction, sometimes it just resets with no context at all.

What steps can reproduce the bug?

Have codex compact the context.

What is the expected behavior?

Expected behavior is context compaction and session continuation

Additional information

No response

Activity

  1. added
    CLIIssues related to the Codex CLI
    contextIssues related to context management (including compaction)
    connectivityIssues involving networking or endpoint connectivity problems (disconnections)
    on May 4, 2026
  2. skypher commented on May 4, 2026

    @skypher

    Can confirm sth similar:

    › continue work

    ■ Error running remote compact task: We're currently
    experiencing high demand, which may cause temporary
    errors.

    Doesn't seem to go away until a new session is started.

  3. nextdimension commented on May 6, 2026

    @nextdimension

    just happened to me

  4. nextdimension commented on May 6, 2026

    @nextdimension

    ■ Error running remote compact task: {
    "error": {
    "message": "Unknown parameter: 'safety_identifier'.",
    "type": "invalid_request_error",
    "param": "safety_identifier",
    "code": "unknown_parameter"
    }
    }

  5. nextdimension commented on May 6, 2026

    @nextdimension

    0.128.0

  6. DuskLin commented on May 6, 2026

    @DuskLin

    just happened to me. It's not just CLIs, apps encounter the exact same issues.

  7. 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).

  8. mahdikayvan commented on May 10, 2026

    @mahdikayvan

    @BottyBott Hey — I know this kind of issue too well. It is very close to the agent reliability problem I’m working on.

    I’m building AgaveCore, and I’d like to let a few early people use it for free while I shape it into something stronger.

    It helps when a coding agent starts to drift, loses important context, or gives you an output you do not fully trust.

    In practice, it works through two habits:

    • tell the agent to remember-progress or remember-this when something important should not be lost
    • use consult-brain when the current task needs more grounded feedback on what to do next

    Over time, as useful journals, decisions, and failures pile up, the product should help the agent make sharper decisions and take better actions with less drift.

    If this sounds relevant, reply here and I’ll send the exact steps. You can also use the email or Telegram on my profile.

    Cheers,
    Mads.

  9. MikeK184 commented on May 13, 2026

    @MikeK184

    still have that issue, quite annoying as it happens frequently

  10. BottyBott commented on May 14, 2026

    @BottyBott
    Author
    Image
  11. PommesPeter commented on May 16, 2026

    @PommesPeter
    Image

    Here's a temporary workaround:

    1. Switch the model to gpt-5.4-mini
    2. Send a message to trigger the compaction
    3. Switch back to your previous model
    4. Continue the conversation
  12. mstapink commented on May 21, 2026

    @mstapink

    The temporary workaround no longer works. I can no longer compact context in any of my open chats. My work cannot be continued until I am able to compact context again.

    no-active-thread-019e4b81-5a50-7081-aac2-a85da3bb5f81

  13. sunpihai-up commented on May 27, 2026

    @sunpihai-up

    I encountered the same bug, and upgrading Codex to the latest version v0.133.0 didn't work either. This bug is critical! Please prioritize this issue!!

  14. garyfpga commented on Jun 5, 2026

    @garyfpga

    have the same problem
    when is it going to be fixed? It is very annoying

  15. 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)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions