Skip to content

fix(agents): support extended thinking on Claude Sonnet 5; move examples off retired model - #164

Draft
ling-senpeng13 wants to merge 1 commit into
mainfrom
fix/sonnet-5-adaptive-thinking
Draft

fix(agents): support extended thinking on Claude Sonnet 5; move examples off retired model#164
ling-senpeng13 wants to merge 1 commit into
mainfrom
fix/sonnet-5-adaptive-thinking

Conversation

@ling-senpeng13

Copy link
Copy Markdown
Contributor

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 using thinkingBudgetTokens end up sending. Any agent combining thinkingBudgetTokens with a Claude 5-family Sonnet model failed with HTTP 400.

Changes

  • SDK: thinkingBudgetTokens is now serialized model-aware — on Sonnet 5+ the budget maps to reasoningEffort (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.
  • Examples: claude-sonnet-4-20250514claude-sonnet-5 everywhere 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.

…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.
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.

1 participant