Skip to content

Compaction/Autocompaction fails #17508

Closed
Closed

Description

@alanxchen85

What version of the Codex App are you using (From “About Codex” dialog)?

Version 26.409.20454 (1462)

What subscription do you have?

pro

What platform is your computer?

Darwin 25.3.0 arm64 arm

What issue are you seeing?

Image

autocompaction gets stuck at this and sends error: 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?

Uploaded thread: 019d7927-56b7-7110-99a9-05daa49544de

in this thread max context is 760k, also happens at 1mm

This is not consistent. sometimes happens sometimes doesn't. sometimes if you keep prompting it you can even get it going again.

What is the expected behavior?

finish autocompaction

Additional information

Bug has been around for a while

Activity

  1. added
    appIssues related to the Codex desktop app
    on Apr 12, 2026
  2. added
    bugSomething isn't working
    contextIssues related to context management (including compaction)
    connectivityIssues involving networking or endpoint connectivity problems (disconnections)
    on Apr 12, 2026
  3. github-actions commented on Apr 12, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  4. removed
    appIssues related to the Codex desktop app
    connectivityIssues involving networking or endpoint connectivity problems (disconnections)
    on Apr 12, 2026
  5. lasertiger commented on Apr 22, 2026

    @lasertiger

    autocompact fails for me too: 019db1fd-7d09-7370-bea2-7e518769131e and shows ■ Error running remote compact task: stream disconnected before completion: error sending request for url (https://api.openai.com/v1/responses/compact)
    no fix? how to fix?

  6. infiloop2 commented on Apr 22, 2026

    @infiloop2

    +1, almost consistently failing for me starting today

  7. alanxchen85 commented on Apr 24, 2026

    @alanxchen85
    Author

    this is making the 5.5 update completely unuasble, especially given that 5.5 only is 258k tokens right now even with settings to 400k. autocompaction gets stuck -> copy thread id for a new session to resume, one turn it its autocompaction again. completely unusable right now. @etraut-openai pls fix thnx!

  8. alanxchen85 commented on Apr 24, 2026

    @alanxchen85
    Author

    Additional live occurrence on 2026-04-24:

    This still happens during real coding work. The failure mode is not just slow compaction; the thread gets stuck in the autocompaction transition and needs manual steering / additional prompts to become usable again.

    Observed today:

    • Thread was mid-task on a multi-file code/debugging fix.
    • Autocompaction interrupted the task.
    • The Codex app thread became stuck enough that Alan had to continue through the CLI instead of the Codex app.
    • After prompting again from CLI, Codex resumed with a compacted summary, but the active control flow had been disrupted.
    • The summary preserved facts like changed files, tests run, root cause, and next step, but the thread no longer continued cleanly from the pending action.
    • User had to ask meta questions to re-establish whether the session was unstuck.

    So there seem to be two related failure surfaces:

    1. The remote compact request can fail/stall with stream disconnected before completion.
    2. Even when the session becomes promptable again, the transition can leave the agent operationally “stuck” until the user manually reorients it, and in this case the practical workaround was switching out of the Codex app to the CLI.

    Expected behavior:

    • If remote compaction fails, return control with a clear recoverable error and do not leave the thread in a half-compacted state.
    • If compaction succeeds after retry/recovery, preserve the active task continuation explicitly: latest user intent, immediate next action, pending blocker/tool step, and whether injected workspace/session instructions are informational or should supersede the active task.

    A useful diagnostic would be exposing whether the failure happened in:

    • upload/sync of thread state
    • remote /backend-api/codex/responses/compact
    • streaming compact response
    • local persistence of compacted summary
    • app state transition back to interactive mode
  9. alanxchen85 commented on Apr 24, 2026

    @alanxchen85
    Author

    To be clear, after testing, this is not autocompaction failing, this is compaction failing in general. I get this error when invoking compaction manually (now that it's available) as well!

  10. changed the title [-]Autocompaction fails[/-] [+]Compaction/Autocompaction fails[/+] on Apr 24, 2026
  11. hchafiatheal commented on Apr 24, 2026

    @hchafiatheal

    Also having same issue, compaction fails in codex app, but not in cli, not sure why @etraut-openai keeps removing the app label from these issues, where clearly it is a codex app issue.

  12. lasertiger commented on Apr 24, 2026

    @lasertiger
  13. psaul20 commented on May 3, 2026

    @psaul20

    Getting the same issue - 019dea5d-63bc-7a52-acf0-48000ae08f95

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

    bugSomething isn't workingcontextIssues 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