[PR #9176] fix(openai): align GPT context windows with codex #13017

Closed
opened 2026-02-16 18:17:54 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/9176

State: closed
Merged: No


What does this PR do?

Updates opencode’s model limit.context handling to match codex’s model_info.rs context-window limits for GPT model families (e.g., gpt-4o* → 128k, gpt-4.1* → 1,047,576, gpt-3.5* → 16,385, gpt-oss* → 96k, gpt-5* → 272k) when loading models from models.dev.

How did you verify your code works?

Ran bun install, then ran the full packages/opencode test suite via bun test (725 pass, 1 skip, 0 fail), plus targeted runs of bun test test/provider/provider.test.ts and bun test test/provider/transform.test.ts.

Fixes https://github.com/anomalyco/opencode/issues/7705

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/9176 **State:** closed **Merged:** No --- ### What does this PR do? Updates opencode’s model limit.context handling to match codex’s model_info.rs context-window limits for GPT model families (e.g., gpt-4o* → 128k, gpt-4.1* → 1,047,576, gpt-3.5* → 16,385, gpt-oss* → 96k, gpt-5* → 272k) when loading models from models.dev. ### How did you verify your code works? Ran bun install, then ran the full packages/opencode test suite via bun test (725 pass, 1 skip, 0 fail), plus targeted runs of bun test test/provider/provider.test.ts and bun test test/provider/transform.test.ts. Fixes https://github.com/anomalyco/opencode/issues/7705
yindo added the pull-request label 2026-02-16 18:17:54 -05:00
yindo closed this issue 2026-02-16 18:17:54 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13017