Skip to content

fix(provider): add thinking level variants for GitHub Copilot Claude models#15167

Open
zhzy0077 wants to merge 1 commit intoanomalyco:devfrom
zhzy0077:fix/copilot-claude-thinking-levels
Open

fix(provider): add thinking level variants for GitHub Copilot Claude models#15167
zhzy0077 wants to merge 1 commit intoanomalyco:devfrom
zhzy0077:fix/copilot-claude-thinking-levels

Conversation

@zhzy0077
Copy link
Contributor

Issue for this PR

Closes #11627

Type of change

  • Bug fix

What does this PR do?

Restores thinking level variant selection for Claude models on the GitHub Copilot provider. In v1.1.48, the variant regressed to a single hardcoded thinking_budget: 4000 under a non-standard "thinking" key.

This change:

  • Adds low (1024), medium (4000), high, and max thinking budget variants
  • Dynamically caps high at min(16_000, floor(output_limit / 2 - 1)) and max at min(31_999, output_limit - 1), matching the direct @ai-sdk/anthropic provider logic
  • This ensures correct budgets across models with different output limits (e.g. Sonnet 32k vs Opus 64k)

How did you verify your code works?

  • Typecheck passes (bun turbo typecheck)
  • Build passes (bun turbo build)
  • Verified the dynamic budget logic matches the existing @ai-sdk/anthropic pattern at lines 543/549 of transform.ts

Screenshots / recordings

N/A - no UI change

Checklist

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

…models

Restore low/medium/high/max thinking budget variants for Claude models on the GitHub Copilot provider. Budget caps for high and max are dynamically computed from the model's output limit, matching the direct Anthropic SDK behavior.

Closes anomalyco#11627

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
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.

[FEATURE]: Lost ability to select Claude thinking variants, thinking invisible after tools

1 participant