Skip to content

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

Closed

Description

@ehendrix23

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

26.611.62324

What subscription do you have?

Pro

What platform is your computer?

Darwin 25.5.0 arm64 arm

What issue are you seeing?

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

What steps can reproduce the bug?

Longer session.

Feedback ID: 019eccf6-1871-7201-92d4-cf0b69975590

What is the expected behavior?

Not getting this issue at all.

Additional information

I also noticed that when this happens "Context" shows 0% used for used and 0 tokens used.
When I then run /compact it works for a bit and then it shows values there.

Activity

  1. added
    appIssues related to the Codex desktop app
    on Jun 18, 2026
  2. added
    bugSomething isn't working
    contextIssues related to context management (including compaction)
    on Jun 18, 2026
  3. github-actions commented on Jun 18, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  4. foeken commented on Jun 21, 2026

    @foeken

    Same issue here. Remote connection. Thread works fine on 'server' (mac app), and client (mac app), but cli remote says:

    Error running remote compact task: Codex ran out of room in the model's context window. Start a new thread or clear earlier history before retrying.

  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

    appIssues related to the Codex desktop appbugSomething 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