Fix Bedrock tool input parsing (L722 short-circuit bug)#4518
Open
amabito wants to merge 1 commit intocrewAIInc:mainfrom
Open
Fix Bedrock tool input parsing (L722 short-circuit bug)#4518amabito wants to merge 1 commit intocrewAIInc:mainfrom
amabito wants to merge 1 commit intocrewAIInc:mainfrom
Conversation
The default "{}" in func_info.get("arguments", "{}") is truthy,
causing the `or` to short-circuit and preventing Bedrock's `input`
key from ever being evaluated. Remove the default so None falls
through correctly.
Author
|
Just checking back in — Bugbot passed and the change is limited to a single-line fix in the Bedrock dict branch of _handle_native_tool_calls. If there's anything specific you'd like validated or adjusted, happy to iterate. |
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.
Root cause:
The default "{}" in:
causes short-circuiting because "{}" is truthy.
For Bedrock-style tool calls (which use
inputinstead offunction.arguments),this prevents
tool_call.get("input", {})from ever being evaluated.Minimal fix:
Remove the default "{}" so
Nonefalls through correctly:This ensures Bedrock tool inputs are parsed as intended.
Note
Low Risk
Very small change to tool-call argument fallback logic; risk is limited to native tool execution when
function.argumentsis missing or falsy.Overview
Fixes native tool-call argument extraction in
CrewAgentExecutor._handle_native_tool_callsby removing the default"{}"value forfunction.arguments, allowing the logic to correctly fall back to Bedrock-styletool_call.inputwhenfunction.argumentsis absent.This prevents a truthy default string from short-circuiting input parsing and ensures the tool receives the intended arguments for Bedrock tool calls.
Written by Cursor Bugbot for commit d45aad4. This will update automatically on new commits. Configure here.