You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GPT-5.6 Codex OAuth uses 1.05M metadata instead of 500k total / 372k input limits #36247
When OpenAI authentication uses Codex OAuth, GPT-5.6 inherits the direct API limits from models.dev:
context: 1,050,000
input: 922,000
output: 128,000
The Codex backend uses a lower input budget for gpt-5.6-sol, gpt-5.6-terra, and gpt-5.6-luna. Comparing the live catalog with OpenCode's existing GPT-5.5 override establishes the mapping:
Without an OAuth-specific GPT-5.6 override, OpenCode waits too long to compact. Once the real input budget is exceeded, the Codex endpoint does not provide a useful error that OpenCode can recover from, leaving the conversation unusable.
OpenCode already handles GPT-5.5 in packages/opencode/src/plugin/openai/codex.ts:
That behavior was added in #24212 to fix #24171. GPT-5.6 is admitted by the generic model filter but does not receive the corresponding Codex limit override.
The Codex values can be independently verified with:
GPT-5.5 reports 272000; all three GPT-5.6 variants report 372000. Each uses effective_context_window_percent: 95.
Expected: extend the existing Codex-OAuth-specific handling to GPT-5.6 using context: 500000, input: 372000, and output: 128000. The direct OpenAI API metadata should remain unchanged.
Plugins
None required. This uses the built-in OpenAI Codex OAuth integration.
OpenCode version
1.17.18 / dev at 1c7f65f105 when reported
Steps to reproduce
Authenticate OpenAI with ChatGPT/Codex OAuth rather than an API key.
Select gpt-5.6-sol, gpt-5.6-terra, or gpt-5.6-luna.
Let a session approach the 372,000-token Codex input budget.
Observe that proactive compaction uses the inherited 922,000-token input metadata and does not run before the Codex backend rejects or terminates the request.
Observe that the session cannot recover cleanly after exceeding the real input budget.
Screenshot and/or share link
Not applicable. The mismatch is reproducible from the live Codex model catalog and the OpenCode OAuth model transform above.
Correction: we initially interpreted codex debug models reporting context_window: 372000 as OpenCode's total context value.
Comparing GPT-5.5 clarified the mapping: Codex reports 272000 for GPT-5.5, while OpenCode's existing OAuth override uses input: 272000, output: 128000, and context: 400000. Applying the same convention to GPT-5.6 gives input: 372000, output: 128000, and context: 500000.
The issue title and body have been corrected. PR #36248 implements the corrected mapping in commit abc5bf44f7.
Activity
nabilfreeman commentedon Jul 10, 2026
@rekram1-node tagging you because I know you worked on adding 5.6 yesterday to models.dev.
[-]GPT-5.6 Codex OAuth uses 1.05M metadata instead of its 372k context limit[/-][+]GPT-5.6 Codex OAuth uses 1.05M metadata instead of 500k total / 372k input limits[/+]nabilfreeman commentedon Jul 10, 2026
Correction: we initially interpreted
codex debug modelsreportingcontext_window: 372000as OpenCode's total context value.Comparing GPT-5.5 clarified the mapping: Codex reports
272000for GPT-5.5, while OpenCode's existing OAuth override usesinput: 272000,output: 128000, andcontext: 400000. Applying the same convention to GPT-5.6 givesinput: 372000,output: 128000, andcontext: 500000.The issue title and body have been corrected. PR #36248 implements the corrected mapping in commit
abc5bf44f7.ChangeHow commentedon Jul 11, 2026
same here ✋
ririnto commentedon Jul 12, 2026
Maybe, feature option will be good.
Like long context(>= 272k) option.