Skip to content

Conversation

@aaiyer
Copy link

@aaiyer aaiyer commented Jan 17, 2026

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 #7705

@github-actions
Copy link
Contributor

Hey! Your PR title Align GPT context windows with Codex doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@aaiyer aaiyer changed the title Align GPT context windows with Codex fix: Align GPT context windows with Codex Jan 17, 2026
@aaiyer aaiyer closed this Jan 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default Codex context length not matching Pro plan

1 participant