Feat: Add Anthropic CUA adaptive thinking

Closed
CH
7mo ago
+392-10

why

what changed

test plan


Summary by cubic

Add adaptive thinking for Anthropic Claude 4.6 models in the CUA client. Uses thinkingEffort with output_config.effort, sets temperature=1, and keeps thinkingBudget for older models.

  • New Features

    • Detects 4.6 models (claude-opus-4-6, claude-sonnet-4-6) and uses thinking: { type: "adaptive" } with output_config.effort.
    • Defaults to "medium" effort when not set and forces temperature: 1 for adaptive thinking.
    • Adds ThinkingEffort and thinkingEffort in ClientOptions ("low" | "medium" | "high" | "max"); falls back to thinking: { type: "enabled", budget_tokens } with thinkingBudget on older models.
    • Uses computer_20251124 for 4.6 and claude-opus-4-5-20251101; tests cover effort levels, defaults and temperature, provider-prefixed names, and legacy budget behavior.
  • Migration

    • For 4.6 models, set thinkingEffort; thinkingBudget is deprecated. Adaptive thinking sets temperature: 1 automatically.
    • Keep using thinkingBudget on older Claude models. No changes needed if you don’t use thinking.