Skip to content

feat(anthropic): fail fast when thinking_display: display is set on adaptive-thinking models#3772

Merged
dgageot merged 2 commits into
docker:mainfrom
dgageot:anthropic-validate-thinking-display
Jul 21, 2026
Merged

feat(anthropic): fail fast when thinking_display: display is set on adaptive-thinking models#3772
dgageot merged 2 commits into
docker:mainfrom
dgageot:anthropic-validate-thinking-display

Conversation

@dgageot

@dgageot dgageot commented Jul 21, 2026

Copy link
Copy Markdown
Member

Anthropic's adaptive-thinking models (Claude Opus/Sonnet 4.6+, Sonnet 5, Fable 5, Mythos 5) only accept thinking_display values of "summarized" or "omitted". Sending "display" causes an HTTP 400 at inference time. Previously docker-agent forwarded the value as-is and the error surfaced only on the first request, with no indication of where to fix it.

This change adds a validateThinkingDisplay function in the Anthropic provider that is called during client construction — both in NewClient and NewVertexClient. A misconfigured thinking_display: display on an adaptive-thinking model now fails at parse time with a clear error message rather than silently at request time. The predicate modelinfo.SupportsFullThinkingDisplay encodes the model boundary, delegating to !SupportsAdaptiveThinking so the two constraints stay in sync. Server-side fallback models (provider_opts.fallbacks) go through the same validation, since they receive the identical request shape. Invalid non-enum values keep their existing warn-and-ignore behavior; no coercion is added.

The schema and docs are updated to reflect that thinking_display is scoped to the Anthropic provider. examples/thinking_budget.yaml is corrected to use a valid value.

dgageot added 2 commits July 21, 2026 17:20
Bedrock does not forward thinking_display so scope it to anthropic only in the schema. Fallbacks receive the same request shape, so validateThinkingDisplay now checks them; adds tests including a NewVertexClient rejection case.

Assisted-By: Claude
@dgageot
dgageot requested a review from a team as a code owner July 21, 2026 15:43

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

Assessment: 🟢 APPROVE

The validation logic is correct and well-structured. validateThinkingDisplay is called at client construction in both NewClient and NewVertexClient, the SupportsFullThinkingDisplay predicate correctly delegates to !SupportsAdaptiveThinking (keeping the two constraints in sync), and fallback models are validated using the same append([]string{cfg.Model}, fallbacks...) idiom used elsewhere. No issues found.

@dgageot
dgageot merged commit 625ce07 into docker:main Jul 21, 2026
16 of 17 checks passed
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.

3 participants