Skip to content

fix(openai): use codex context limits for gpt-5.6#36248

Open
nabilfreeman wants to merge 4 commits into
anomalyco:devfrom
nabilfreeman:gpt56-oauth-limit
Open

fix(openai): use codex context limits for gpt-5.6#36248
nabilfreeman wants to merge 4 commits into
anomalyco:devfrom
nabilfreeman:gpt56-oauth-limit

Conversation

@nabilfreeman

@nabilfreeman nabilfreeman commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #36247

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

OpenCode inherits the direct API's 1.05M limits for GPT-5.6 even when OpenAI authentication routes requests through Codex OAuth. The Codex catalog reports a 372K input budget for Sol, Terra, and Luna.

This extends the existing GPT-5.5 OAuth override to use context: 500000, input: 372000, and output: 128000 for all three GPT-5.6 models. API-key authentication continues using the direct API metadata unchanged.

How did you verify your code works?

  • bun test test/plugin/codex.test.ts (17 pass)
  • bun typecheck from packages/opencode
  • pre-push bun turbo typecheck (30 successful)

Screenshots / recordings

Not applicable; this is a provider metadata fix with no UI changes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added contributor needs:compliance This means the issue will auto-close after 2 hours. labels Jul 10, 2026
@nabilfreeman

Copy link
Copy Markdown
Contributor Author

@rekram1-node tagging you because I know you worked on adding 5.6 yesterday to models.dev.

@nabilfreeman nabilfreeman marked this pull request as ready for review July 10, 2026 13:13
@nabilfreeman

Copy link
Copy Markdown
Contributor Author

Correction on the limit mapping: we initially interpreted codex debug models reporting context_window: 372000 as OpenCode's total context value.

Comparing it with GPT-5.5 clarified the convention. Codex reports 272000 for GPT-5.5, while OpenCode's existing OAuth override maps that to input: 272000, then adds the 128000 output allowance for context: 400000.

This PR now follows the same mapping for GPT-5.6:

context: 500000
input:   372000
output:  128000

The correction is in abc5bf44f7. The focused Codex tests and package typecheck pass, and the pre-push workspace typecheck completed all 30 tasks successfully.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Jul 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GPT-5.6 Codex OAuth uses 1.05M metadata instead of 500k total / 372k input limits

1 participant