fix: resolve empty arguments for Bedrock native tool calls#5158
Open
IgnazioDS wants to merge 1 commit intocrewAIInc:mainfrom
Open
fix: resolve empty arguments for Bedrock native tool calls#5158IgnazioDS wants to merge 1 commit intocrewAIInc:mainfrom
IgnazioDS wants to merge 1 commit intocrewAIInc:mainfrom
Conversation
The default value "{}" in func_info.get("arguments", "{}") is truthy,
preventing the or-chain from falling through to tool_call.get("input")
which is where Bedrock places tool arguments. Remove the default so
None triggers the fallback correctly.
Fixes crewAIInc#4972
Fixes crewAIInc#4748
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.
Summary
_parse_native_tool_callto correctly read Bedrock tool argumentsor-chain fallback was broken becauseget("arguments", "{}")returns a truthy default, preventing fallthrough totool_call.get("input")where Bedrock places argumentsProblem
All AWS Bedrock models (Nova, Claude via Bedrock) always receive empty
{}arguments when using native tool calling. Two independent issues report this: #4972 and #4748.Fix
Test plan
"{}"works when neither key is presentFixes #4972, Fixes #4748
Note
Low Risk
Low risk, single-line change in native tool-call parsing; main concern is any provider relying on the previous default
"{}"masking missing arguments.Overview
Fixes native tool-call argument parsing in
CrewAgentExecutor._parse_native_tool_callso dict-style calls (notably AWS Bedrock) correctly fall back fromfunction.argumentsto the top-levelinputpayload instead of always defaulting to an empty{}.Written by Cursor Bugbot for commit fd2d040. This will update automatically on new commits. Configure here.