Skip to content

feat(core): enable low/med/high variants for Claude Sonnet/Opus 4.6 thinking - #14

Open
sebastianlungu wants to merge 3 commits into
cortexkit:mainfrom
sebastianlungu:feat/claude-thinking-variants-low-med-high
Open

feat(core): enable low/med/high variants for Claude Sonnet/Opus 4.6 thinking#14
sebastianlungu wants to merge 3 commits into
cortexkit:mainfrom
sebastianlungu:feat/claude-thinking-variants-low-med-high

Conversation

@sebastianlungu

@sebastianlungu sebastianlungu commented Sep 2, 2026

Copy link
Copy Markdown

Summary

Enables low/medium/high variants for both antigravity-claude-sonnet-4-6-thinking and antigravity-claude-opus-4-6-thinking with thinkingConfig.thinkingBudget 8192/16384/32768 matching THINKING_TIER_BUDGETS.claude.

Previously these models advertised {disabled:true} variants, so OpenCode's variant picker showed no options and --variant was ignored. Gemini flash/pro already had working thinkingLevel variants; Claude now matches.

Changes

  • packages/core/src/model-registry.ts: replace disabled variants with budgets (NET +4 lines, functionally NET 0 replacement)
  • packages/opencode/src/plugin/config/models.test.ts: update expectation

Verification

  • ./node_modules/.bin/tsc -p packages/core/tsconfig.build.json passes
  • bun test --isolate packages/core/src/model-registry.test.ts 7 pass
  • bun test --isolate packages/opencode/src/plugin/config/models.test.ts 4 pass
  • Variant extraction already supports providerOptions.google.thinkingConfig.thinkingBudget + generationConfig fallback (packages/core/src/transform/model-resolver.ts:resolveModelWithVariant)

Tested via

opencode debug config | jq '.provider.google.models["antigravity-claude-sonnet-4-6-thinking"].variants'
# -> {low:{thinkingBudget:8192}, medium:{thinkingBudget:16384}, high:{thinkingBudget:32768}}
OPENCODE_ANTIGRAVITY_DEBUG=1 opencode run "test" --model google/antigravity-claude-sonnet-4-6-thinking --variant medium
# -> generationConfig.thinkingConfig.thinking_budget:16384

Closes configurability request for Claude Sonnet effort. Net LOC: +4/-4 effectively 0 (swap disabled for budgets).


Summary by cubic

Enables low/medium/high thinking variants for Claude Sonnet/Opus 4.6 so the variant picker and --variant flag now control thinking effort. Previously these models advertised disabled variants, so no options showed and the flag was ignored.

Changes

  • Replaces disabled variants with thinking budgets of 8192/16384/32768 in packages/core/src/model-registry.ts.
  • Orders the new variants low→medium→high so the TUI picker lists them consistently.
  • Updates test expectations in packages/opencode/src/plugin/config/models.test.ts.
  • Adds wire-level tests proving each budget maps to thinkingConfig.thinkingBudget on Antigravity requests.

Written for commit 8319a59. Summary will update on new commits.

Review in cubic

…hinking

Replace disabled variants with thinkingConfig budgets (8192/16384/32768)
matching THINKING_TIER_BUDGETS.claude. Allows OpenCode variant picker
and --variant flag to control Claude thinking effort via
providerOptions.google.thinkingConfig.thinkingBudget.

Fixes effort configurability; gemini variants already supported.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

@ualtinok ualtinok left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested

This should not enable low / medium / high as supported Claude effort tiers without further evidence.

I revalidated both Claude routes against native AGY CLI 1.1.24 and the live endpoint:

  • agy --model claude-sonnet-4-6 --effort low|medium|high rejects every selection with --effort is not supported for model "claude-sonnet-4-6".
  • Native Sonnet and Opus MITM captures both send thinkingConfig: { includeThoughts: true, thinkingBudget: 1024 } with maxOutputTokens: 64000.
  • Replaying the captured Sonnet request with 8192, 16384, and 32768 returns HTTP 200, but that establishes only that the backend tolerates those values. It does not establish low/medium/high effort semantics, and controlled responses did not show a monotonic budget-to-effort relationship.

The current disabled variants are therefore deliberate native-parity behavior. This patch would advertise unsupported effort controls and send up to 32x the native budget.

The verification also does not cover the production seam. request.ts independently uses extractVariantThinkingConfig; it does not call the cited resolveModelWithVariant. Please add request-level tests proving the final Antigravity payload for every proposed preset. The Antigravity wire field is camel-case thinkingBudget, not the snake-case thinking_budget shown in the PR description.

Required direction: either keep these variants disabled, or redesign this explicitly as a non-native/experimental custom-budget feature with validated semantics, accurate UI wording, final-wire tests, and user-facing documentation.

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.

2 participants