opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix: Align GPT context windows with Codex

Open aaiyer opened this issue 11 hours ago • 2 comments

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

aaiyer avatar Jan 17 '26 23:01 aaiyer