Skip to content

Support Anthropic adaptive thinking API (replace deprecated budget_tokens) #7293

@clouatre

Description

@clouatre

Please explain the motivation behind the feature request.

Goose currently uses the deprecated thinking: {type: "enabled", budget_tokens: N} API for Anthropic extended thinking (via CLAUDE_THINKING_ENABLED and CLAUDE_THINKING_BUDGET env vars). Anthropic has introduced adaptive thinking as the replacement, available on Claude Sonnet 4.6 and Opus 4.6. With adaptive thinking, Claude decides if and when to think based on problem complexity, rather than always consuming a fixed token budget. The deprecated budget_tokens parameter will eventually stop working on newer models.

Relevant code:

  • crates/goose/src/providers/formats/anthropic.rs
  • crates/goose/src/providers/formats/databricks.rs

Describe the solution you'd like

Support the new adaptive thinking API payload:

{"thinking": {"type": "adaptive", "effort": "high"}}
  • Add a CLAUDE_THINKING_EFFORT env var accepting low, medium, high, max (default: high)
  • When set, use type: "adaptive" instead of type: "enabled"
  • Keep CLAUDE_THINKING_ENABLED as the toggle
  • Deprecate CLAUDE_THINKING_BUDGET with a warning if set
  • Consider surfacing effort as a config option (not just env var) longer term

Describe alternatives you've considered

  • Keep using the deprecated budget_tokens API -- works for now but will break on future models.
  • Skip env vars entirely and auto-detect model support -- cleaner but less user control over effort levels.

Additional context

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions