Skip to content

Error running remote compact task while using 5.3codex-spark #29529

Closed

Description

@martinmclee

What version of Codex CLI is running?

codex-cli 0.142.0 with the codex desktop

What subscription do you have?

Pro 5x

Which model were you using?

5.3codex-spark

What platform is your computer?

Not provided.

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

Not provided.

What issue are you seeing?

While working in Codex, the session hit:

Error running remote compact task: {
"error": {
"message": "Your input exceeds the context window of this model. Please adjust your input and try again.",
"type": "invalid_request_error",
"param": "input",
"code": "context_length_exceeded"
}
}

and then displayed:

Codex ran out of room in the model's context window. Start a new thread or clear earlier history before retrying.

The same behavior appears to align with context_length_exceeded/remote compaction failures being reported in other open issues.

What steps can reproduce the bug?

  1. Use model 5.3codex-spark in a Codex session.
  2. Continue with task until remote compaction is triggered (or manual /compact equivalent is invoked).
  3. Receive Error running remote compact task and the context-window message, preventing normal continuation of the same thread.

What is the expected behavior?

Remote compaction should recover from large context state and complete or offer a safe handoff path without forcing the user to lose context by starting over.

Additional information

  • This appears to be another occurrence of the ongoing compaction regression around context_length_exceeded.
  • Please let me know if you want me to attach extra diagnostics (thread id/session id, codex version, platform, and full logs).

Activity

  1. martinmclee commented on Jun 23, 2026

    @martinmclee
    Author

    Research I found while filing this (context-management family):

    This is the first report I saw explicitly tied to 5.3codex-spark wording, so I filed separately to avoid model/variant ambiguity.

  2. added
    bugSomething isn't working
    CLIIssues related to the Codex CLI
    contextIssues related to context management (including compaction)
    on Jun 23, 2026
  3. martinmclee commented on Jun 26, 2026

    @martinmclee
    Author

    I can reproduce this on Windows with:

    • Desktop app: OpenAI.Codex 26.616.10790.0
    • CLI: codex-cli 0.142.0 (codex --version)
    • model: 5.3-codex-spark

    It fails during startup work with:
    Error running remote compact task... context_length_exceeded
    and then Codex ran out of room in the model's context window...

    For the same desktop+CLI on Windows, 5.5 appears stable in this same workflow. This points to a 5.3 spark-specific startup/context behavior regression in this thread.

  4. devansh-jain-18 commented on Jun 26, 2026

    @devansh-jain-18

    Adding a related datapoint from #30194 before closing it as duplicate.

    Another observed shape is that compaction may appear to run, but effective context usage does not meaningfully reduce, leaving the next turn still near-full / under context pressure. So the failure mode is broader than the explicit context_length_exceeded error: compaction needs to reclaim enough usable context to continue, or clearly report that it could not.

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