fix(agents): support extended thinking on Claude Sonnet 5; move examples off retired model - #164
Draft
ling-senpeng13 wants to merge 1 commit into
Draft
fix(agents): support extended thinking on Claude Sonnet 5; move examples off retired model#164ling-senpeng13 wants to merge 1 commit into
ling-senpeng13 wants to merge 1 commit into
Conversation
…es to claude-sonnet-5 Claude Sonnet 5 rejects the legacy thinking.type=enabled + budget_tokens shape (HTTP 400) and the server's Anthropic provider still renders thinkingConfig that way for Sonnet-line models. Translate thinkingBudgetTokens into reasoningEffort client-side for Sonnet 5+ (same tiers the server uses for Opus); Sonnet 5 runs adaptive thinking by default. Also replace the retired claude-sonnet-4-20250514 with claude-sonnet-5 across examples.
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 retired
claude-sonnet-4-20250514, which several examples pinned — and its replacement,claude-sonnet-5, rejects the legacy extended-thinking request shape (thinking.type: enabled+budget_tokens) that agents usingthinkingBudgetTokensend up sending. Any agent combiningthinkingBudgetTokenswith a Claude 5-family Sonnet model failed with HTTP 400.Changes
thinkingBudgetTokensis now serialized model-aware — on Sonnet 5+ the budget maps toreasoningEffort(Sonnet 5 thinks adaptively by default), using the same budget→effort tiers the server applies for Opus. All other models keep the existing wire shape.claude-sonnet-4-20250514→claude-sonnet-5everywhere it appeared.Verified against conductor-oss 3.32.0-rc18: example 59 (extended thinking) now completes end-to-end on
claude-sonnet-5; 60/60a clear the API error. New serializer tests cover the translation and the legacy path.