codex - 💡(How to fix) Fix Codex ran out of room in the model's context window. Start a new thread or clear earlier history before retrying [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#19269Fetched 2026-04-24 10:39:41
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3closed ×1commented ×1

Error Message

retrying.■ Error running remote compact task: { "error": {

Root Cause

After a few hours of working, i start getting this which is the 1st time ever, i'm not sure if there is a bug or this is a new feature, because whatever it is this is really so bad, and even with 258K context window, we're working on a huge project and this new bug/feature is completely destroying everything!

RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

v0.124.0

What subscription do you have?

Pro 20x

Which model were you using?

gpt-5.5 xhigh

What platform is your computer?

Darwin 25.4.0 arm64 arm

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

VSCode

What issue are you seeing?

After a few hours of working, i start getting this which is the 1st time ever, i'm not sure if there is a bug or this is a new feature, because whatever it is this is really so bad, and even with 258K context window, we're working on a huge project and this new bug/feature is completely destroying everything!

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

this never happen before with gpt-5.4 xhigh at all, i even have a very long session with gpt-5.4 i used over 5b tokens in the same session without any issues, but with gpt-5.5 xhigh i even didn't reach 20m/t and start getting this

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

Also

retrying.■ 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" } }

What steps can reproduce the bug?

Just working for a few hours and reached about 20m/t of usage and start getting this!

What is the expected behavior?

it should be fixed just like how we was using it with gpt-5.4 xhigh, not sure if this is a model limits or feature or a Codex CLI bug!

Additional information

No response

extent analysis

TL;DR

The issue can be mitigated by starting a new thread or clearing earlier history to free up space in the model's context window.

Guidance

  • The error message suggests that the model's context window has been exceeded, which is a likely cause of the issue.
  • To verify, try starting a new thread or clearing earlier history and see if the issue persists.
  • Consider adjusting your input to fit within the context window limits of the gpt-5.5 xhigh model.
  • If the issue is specific to the gpt-5.5 xhigh model, try switching back to gpt-5.4 xhigh to see if the issue is model-related.

Notes

The issue may be due to changes in the context window limits between gpt-5.4 xhigh and gpt-5.5 xhigh models, or it could be a bug in the Codex CLI.

Recommendation

Apply workaround: Start a new thread or clear earlier history to free up space in the model's context window, as this is a straightforward solution to mitigate the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Codex ran out of room in the model's context window. Start a new thread or clear earlier history before retrying [1 comments, 2 participants]