Description
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:
codex debug OpenCode input OpenCode output OpenCode context
GPT-5.5 272,000 272,000 128,000 400,000
GPT-5.6 variants 372,000 372,000 128,000 500,000
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:
limit: model.id.includes("gpt-5.5")
? {
context: 400_000,
input: 272_000,
output: 128_000,
}
: model.limit
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:
codex debug models 2>/dev/null |
jq '.models[] | select(.slug == "gpt-5.5" or (.slug | startswith("gpt-5.6"))) |
{slug, context_window, max_context_window, effective_context_window_percent}'
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.
Operating System
macOS
Terminal
Any
Description
When OpenAI authentication uses Codex OAuth, GPT-5.6 inherits the direct API limits from models.dev:
The Codex backend uses a lower input budget for
gpt-5.6-sol,gpt-5.6-terra, andgpt-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 report372000. Each useseffective_context_window_percent: 95.Expected: extend the existing Codex-OAuth-specific handling to GPT-5.6 using
context: 500000,input: 372000, andoutput: 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 /
devat1c7f65f105when reportedSteps to reproduce
gpt-5.6-sol,gpt-5.6-terra, orgpt-5.6-luna.Screenshot and/or share link
Not applicable. The mismatch is reproducible from the live Codex model catalog and the OpenCode OAuth model transform above.
Operating System
macOS
Terminal
Any