Skip to content

Clarify thinking_budget docs and support adaptive thinking for Claude Opus 4.6+ on Bedrock#3096

Open
dgageot wants to merge 3 commits into
docker:mainfrom
dgageot:fix/3093-thinking-budget-adaptive-bedrock
Open

Clarify thinking_budget docs and support adaptive thinking for Claude Opus 4.6+ on Bedrock#3096
dgageot wants to merge 3 commits into
docker:mainfrom
dgageot:fix/3093-thinking-budget-adaptive-bedrock

Conversation

@dgageot

@dgageot dgageot commented Jun 12, 2026

Copy link
Copy Markdown
Member

Claude Opus 4.8 and Bedrock-hosted Opus models now require adaptive thinking mode rather than token-based budgets. This PR extends the codebase to recognize these models and automatically adapt their thinking configuration while clarifying the documentation across all providers.

The changes add a bedrockClaudeModelName helper to recognize Bedrock-style model IDs alongside their regular names in modelinfo.RejectsTokenThinking, implement adaptive thinking support in the Bedrock provider with automatic coercion of token budgets to adaptive effort levels (with warnings), and suppress temperature/top_p settings appropriately for adaptive requests. Sonnet-class models retain their existing token-to-effort mapping without behavior changes.

Documentation updates remove false claims about adaptive thinking support in OpenAI and clarify per-provider thinking_budget capabilities. The Bedrock section now explains adaptive thinking requirements for Opus 4.6+, and examples include a realistic Bedrock Opus 4.8 configuration. All tests pass including new coverage for Bedrock adaptive thinking scenarios and Opus 4.8 model recognition.

Fixes #3093

dgageot added 3 commits June 12, 2026 18:14
…Ds, add adaptive thinking support to Bedrock provider

- Recognize Claude Opus 4.8 and Bedrock-style model IDs (global/regional prefixes) as requiring adaptive thinking
- Add Client.adaptiveThinkingEffort() to detect and handle adaptive thinking modes
- Map effort levels to adaptive output_config.effort on Opus 4.6+ models
- Auto-coerce token budgets to adaptive with a warning on models that reject token-based thinking
- Add comprehensive test coverage for adaptive thinking scenarios

Fixes docker#3093
- Anthropic: clarify token budgets (1024–32768) vs adaptive thinking (Opus 4.6+); explain auto-coercion of effort levels
- Bedrock: document adaptive thinking requirement for Opus 4.6+ models; explain token-budget coercion
- OpenAI: remove false claims about adaptive thinking; clarify only effort levels accepted, no token counts
- xAI/Mistral: correct that thinking_budget is not applied (reasoning_effort only for OpenAI model names)
- Gemini: fix example model names and effort level accuracy per provider
- Generic: add per-provider effort values and clear disabling guidance; mention Docker Model Runner support
- Examples: add Bedrock Opus 4.8 adaptive example; fix provider defaults to use token values

Fixes docker#3093
…r, clearer adaptive-thinking logging, edge-case tests, and Gemini/Bedrock docs clarifications
@dgageot dgageot requested a review from a team as a code owner June 12, 2026 16:41
@aheritier aheritier added area/providers/anthropic For features/issues/fixes related to the usage of Anthropic models area/providers/bedrock AWS Bedrock provider support kind/fix PR fixes a bug (maps to fix: commit prefix) labels Jun 12, 2026

@docker-agent docker-agent 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.

Assessment: 🟢 APPROVE

Reviewed changes in PR #3096 ("Clarify thinking_budget docs and support adaptive thinking for Claude Opus 4.6+ on Bedrock").

Scope of changes reviewed:

  • pkg/model/provider/bedrock/client.go — adaptive thinking support, temperature/top_p suppression, coercion of token budgets to effort levels
  • pkg/model/modelinfo/modelinfo.gobedrockClaudeModelName helper, Opus 4.8 recognition, RejectsTokenThinking extension
  • pkg/model/provider/bedrock/client_test.go — new test coverage for adaptive thinking paths
  • Documentation updates across all providers (docs/guides/thinking/index.md, docs/providers/*/index.md)

No bugs found. The implementation correctly:

  • Coerces token-based thinking_budget values to Bedrock's effort levels with appropriate user-facing warnings
  • Suppresses temperature and top_p for adaptive thinking requests (matching Bedrock API requirements)
  • Extends RejectsTokenThinking to cover both the canonical Opus 4.8 model ID and Bedrock-namespaced variants via the new bedrockClaudeModelName helper
  • Adds adequate test coverage for the new coercion and suppression logic

@docker-agent

Copy link
Copy Markdown

PR Review Failed — The review agent encountered an error and could not complete the review. View logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/providers/anthropic For features/issues/fixes related to the usage of Anthropic models area/providers/bedrock AWS Bedrock provider support kind/fix PR fixes a bug (maps to fix: commit prefix)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify thinking_budget docs for Claude Opus 4.8 adaptive thinking

3 participants