feat(anthropic): fail fast when thinking_display: display is set on adaptive-thinking models#3772
Merged
dgageot merged 2 commits intoJul 21, 2026
Conversation
…daptive-thinking models
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
trungutt
approved these changes
Jul 21, 2026
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Anthropic's adaptive-thinking models (Claude Opus/Sonnet 4.6+, Sonnet 5, Fable 5, Mythos 5) only accept
thinking_displayvalues 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
validateThinkingDisplayfunction in the Anthropic provider that is called during client construction — both inNewClientandNewVertexClient. A misconfiguredthinking_display: displayon an adaptive-thinking model now fails at parse time with a clear error message rather than silently at request time. The predicatemodelinfo.SupportsFullThinkingDisplayencodes the model boundary, delegating to!SupportsAdaptiveThinkingso 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_displayis scoped to the Anthropic provider.examples/thinking_budget.yamlis corrected to use a valid value.