codex - 💡(How to fix) Fix Codex Pro GPT-5.4 long context regressed: ~672k worked Apr 22, ~290k fails Apr 23 [8 comments, 6 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#19142Fetched 2026-04-24 06:00:01
View on GitHub
Comments
8
Participants
6
Timeline
25
Reactions
5
Timeline (top)
commented ×8cross-referenced ×7labeled ×4mentioned ×2
RAW_BUFFERClick to expand / collapse

Codex desktop app: 26.417.41555 Bundled app-server: codex-cli 0.122.0-alpha.13 Homebrew CLI after upgrade: codex-cli 0.123.0 Auth mode: ChatGPT Plan shown in logs: pro Rate limit shown in logs: limit_reached=false

Config: model = "gpt-5.4" model_context_window = 1000000 model_auto_compact_token_limit = 700000

Observed:

  • Apr 22: GPT-5.4 turns succeeded around 635k-672k total tokens with auto_compact_limit=700000.
  • Apr 23: GPT-5.4 turns started failing around 270k-309k tokens with: "Codex ran out of room in the model's context window. Start a new thread or clear earlier history before retrying."

Expected: Codex Pro + GPT-5.4 should continue using the long-context route as it did Apr 22, or auto-compact before rejection.

Actual: Client keeps auto_compact_limit=700000, but backend/app-server rejects around the ~272k boundary.

extent analysis

TL;DR

The issue is likely caused by a mismatch between the client's auto-compact limit and the backend's context window limit, resulting in the Codex app rejecting requests around the 272k token boundary.

Guidance

  • Verify that the model_auto_compact_token_limit is being correctly sent to the backend and that it is being respected.
  • Check the backend logs to see if there are any errors or warnings related to the context window limit or auto-compact limit.
  • Consider reducing the model_auto_compact_token_limit to a value closer to the 272k boundary to see if it resolves the issue.
  • Investigate if the upgrade to codex-cli 0.123.0 introduced any changes to the context window limit or auto-compact behavior.

Example

No code snippet is provided as the issue seems to be related to configuration and backend behavior.

Notes

The issue may be specific to the GPT-5.4 model or the pro plan, and further investigation is needed to determine the root cause.

Recommendation

Apply workaround: Reduce the model_auto_compact_token_limit to a value closer to the 272k boundary to see if it resolves the issue, as the current limit seems to be mismatched with the backend's context window limit.

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 Pro GPT-5.4 long context regressed: ~672k worked Apr 22, ~290k fails Apr 23 [8 comments, 6 participants]