Skip to content

Fix: fix bedrock payload handler for parallel and strict tool use, add fallback for thinking on claude#715

Merged
cosminacho merged 1 commit intomainfrom
fix/fix_payload_handler_extended_thinking_anthropic
Mar 23, 2026
Merged

Fix: fix bedrock payload handler for parallel and strict tool use, add fallback for thinking on claude#715
cosminacho merged 1 commit intomainfrom
fix/fix_payload_handler_extended_thinking_anthropic

Conversation

@cosminacho
Copy link
Contributor

@cosminacho cosminacho commented Mar 20, 2026

Notes on Claude with Extended thinking:

The react loop we have in the SDK will not work on Claude when enabling extended_thinking due to several reasons:

  • Claude needs tool_choice="auto" to work with extended_thinking
  • Claude expects a specific interaction format for extended_thinking: input-> ai_message with_tool_calls -> resolve tool calls -> finish the interaction with an ai_message.
  • Striping thinking from the model and invoking with force_tool_use can't be done during an 'interaction'.

Solution: I'm working on implementing a custom agentic loop for Claude with thinking
I still need the changes in this PR in order to reautilize the methods and payload handlers.

@cosminacho cosminacho force-pushed the fix/fix_payload_handler_extended_thinking_anthropic branch 5 times, most recently from bb1c61a to adcaf5b Compare March 23, 2026 09:46
@cosminacho cosminacho force-pushed the fix/fix_payload_handler_extended_thinking_anthropic branch 2 times, most recently from 29e5862 to bc76f60 Compare March 23, 2026 13:43
@cosminacho cosminacho force-pushed the fix/fix_payload_handler_extended_thinking_anthropic branch from bc76f60 to c3a16da Compare March 23, 2026 13:45
@cosminacho cosminacho merged commit 437fac8 into main Mar 23, 2026
42 checks passed
@cosminacho cosminacho deleted the fix/fix_payload_handler_extended_thinking_anthropic branch March 23, 2026 13:50
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.

2 participants