fix(opencode): correct GitHub Copilot Claude context limits and thinking variants#20318
Closed
MoonFuji wants to merge 1 commit intoanomalyco:devfrom
Closed
fix(opencode): correct GitHub Copilot Claude context limits and thinking variants#20318MoonFuji wants to merge 1 commit intoanomalyco:devfrom
MoonFuji wants to merge 1 commit intoanomalyco:devfrom
Conversation
…ing variants - provider.ts: override models.dev incorrect context/output limits for GitHub Copilot Claude models in fromModelsDevModel(). models.dev reports wrong values (e.g. claude-opus-4.6 as 144k context) vs Anthropic docs. - transform.ts: fix @ai-sdk/github-copilot claude branch in variants() to return adaptive effort levels (low/medium/high/max for opus-4.6 and sonnet-4.6; high/max for other claude models) instead of a single hardcoded 'thinking' variant. Fixes anomalyco#20317
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #20317
Type of change
What does this PR do?
Two bugs affect Claude models when used via the GitHub Copilot provider:
1. Wrong context/output limits —
models.devhas incorrect values for GitHub Copilot Claude models (e.g.claude-opus-4.6is listed as 144k context/64k output, correct is 1M/128k). Fixed inprovider.tsinsidefromModelsDevModel()with a lookup table that overrides the wrong values for Copilot+Claude combos, using the values from Anthropic's official model documentation.2. Missing adaptive thinking variants —
transform.tshad a@ai-sdk/github-copilotbranch that returned only a single hardcodedthinkingentry for any Claude model. TheisAnthropicAdaptivevariable (already computed at the top ofvariants()) was unused in this branch. Fixed to returnlow/medium/high/maxfor adaptive models (opus-4.6,sonnet-4.6) andhigh/maxfor other Claude models, matching the Anthropic direct-provider behavior.How did you verify your code works?
models.devAPI and confirmed the wrong values are presentvariants()function and confirmedisAnthropicAdaptivewas already correctly detecting the model IDs but was never used in the@ai-sdk/github-copilotbranchChecklist