Skip to content

fix(provider): cap Codex gpt-5.5 context window at 400K#162

Open
justrach wants to merge 1 commit into
release/0.2.17from
fix/codex-gpt-5.5-context-length
Open

fix(provider): cap Codex gpt-5.5 context window at 400K#162
justrach wants to merge 1 commit into
release/0.2.17from
fix/codex-gpt-5.5-context-length

Conversation

@justrach

@justrach justrach commented Jun 4, 2026

Copy link
Copy Markdown
Owner

What

gpt-5.5 on the Codex provider was configured with a 1,000,000-token context window, but Codex caps it at 400K (openai/codex#19464) — the raw API supports 1M, the Codex subscription does not.

Because the compaction threshold is 0.9 x context_window (forge_domain/src/agent.rs:316), the trigger sat at ~900K and never fired before the provider hard-rejected the turn with context_length_exceeded.

Fix

crates/forge_repo/src/provider/provider.json — Codex gpt-5.5 context_length: 1000000 -> 400000, matching the other Codex models (all <= 272K except gpt-5.4-mini at 400K). New compaction threshold: 0.9 x 400000 = 360K, so context compacts before the 400K ceiling.

The direct-API gpt-5.5-2026-04-23 / -pro entries (1.05M) are left untouched — the raw API genuinely supports 1M.

Verification

JSON validated; cargo check -p forge_repo clean. (Embedded data file — takes effect after a rebuild.)

🤖 Generated with Claude Code

gpt-5.5 on the Codex provider was configured with a 1,000,000-token
context window, but Codex enforces a 400K cap (openai/codex#19464) even
though the raw API supports 1M. The compaction threshold is derived from
the model's context window (0.9 x window), so the trigger sat at ~900K
and never fired before the provider hard-rejected with
context_length_exceeded.

Set the Codex gpt-5.5 context_length to 400000 -- matching the other
Codex models (all <= 272K except gpt-5.4-mini at 400K). The compaction
threshold is now 0.9 x 400000 = 360K, so context compacts before the
real ceiling. The direct-API gpt-5.5 entries (1.05M) are left unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Action required: PR inactive for 5 days.
Status update or closure in 10 days.

@github-actions github-actions Bot added the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state: inactive No current action needed/possible; issue fixed, out of scope, or superseded.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant