fix(bedrock): always include toolConfig when messages contain toolUse/toolResult blocks#196
Open
manusjs wants to merge 1 commit intovxcontrol:masterfrom
Open
fix(bedrock): always include toolConfig when messages contain toolUse/toolResult blocks#196manusjs wants to merge 1 commit intovxcontrol:masterfrom
manusjs wants to merge 1 commit intovxcontrol:masterfrom
Conversation
…/toolResult blocks Ensure WithTools option is applied last in CallWithTools (consistent with CallEx) so provider config options cannot accidentally overwrite restored tool definitions. Add integration test covering the exact issue vxcontrol#160 scenario: chain with toolUse/toolResult blocks but no explicit tools in the current turn. Fixes vxcontrol#160 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
What
Ensures
toolConfigis always present in the Bedrock Converse API request when the message history containstoolUseortoolResultcontent blocks.Fixes #160
Root Cause
The Bedrock Converse API requires
toolConfigto be defined whenever a request or its history containstoolUse/toolResultblocks. The provider was only includingtoolConfigwhen new tool definitions were being added for the current turn, omitting it when tools were already embedded in history. This produced:Changes
toolUse/toolResultblocks. If found andtoolConfigis nil/empty, injects a minimaltoolConfigwith the tools referenced in the chain.bedrock_test.go: 4 new subtests — nil tools with tool-containing chain, empty tools slice with tool-containing chain, tools already set (no change), no tool blocks (no injection).