[Claimed #1912] Feat: Add Anthropic CUA adaptive thinking
Merged
GI
7mo ago+510+510+012345678901234567890123456789-12-12-01234567890123456789
Mirrored from external contributor PR #1912 after approval by @miguelg719.
Original author: @chromiebot
Original PR: https://github.com/browserbase/stagehand/pull/1912
Approved source head SHA: 0ea0332c525017c727743d11a68b8eb74f76b646
@chromiebot, please continue any follow-up discussion on this mirrored PR. When the external PR gets new commits, this same internal PR will be marked stale until the latest external commit is approved and refreshed here.
Original description
why
what changed
test plan
Summary by cubic
Add adaptive thinking for Anthropic Claude 4.6 models in the CUA client with effort controls and automatic temperature=1. Keeps legacy thinkingBudget for older models and improves model detection and tool versioning.
-
New Features
- Detects 4.6 models (e.g.,
claude-opus-4-6*,claude-sonnet-4-6*, incl. provider-prefixed) and sendsthinking: { type: "adaptive" }withoutput_config.effort(defaults to"medium"). - Adds
ThinkingEffortandthinkingEffortinClientOptions("none" | "low" | "medium" | "high" | "max");"none"disables adaptive thinking. - Forces
temperature: 1with adaptive thinking and logs when overriding a user value; logs whenthinkingBudgetis provided on 4.6 models. - Uses
computer_20251124for 4.6 andclaude-opus-4-5-20251101; older models continue withthinking: { type: "enabled", budget_tokens }.
- Detects 4.6 models (e.g.,
-
Migration
- For 4.6 models, set
thinkingEffort;thinkingBudgetis ignored. - Adaptive thinking forces
temperature: 1; setthinkingEffort: "none"to disable.
- For 4.6 models, set