Skip to content

Comments

Fix Bedrock tool input parsing (L722 short-circuit bug)#4518

Open
amabito wants to merge 1 commit intocrewAIInc:mainfrom
amabito:fix/bedrock-tool-input-parsing
Open

Fix Bedrock tool input parsing (L722 short-circuit bug)#4518
amabito wants to merge 1 commit intocrewAIInc:mainfrom
amabito:fix/bedrock-tool-input-parsing

Conversation

@amabito
Copy link

@amabito amabito commented Feb 19, 2026

Root cause:
The default "{}" in:

func_args = func_info.get("arguments", "{}") or tool_call.get("input", {})

causes short-circuiting because "{}" is truthy.
For Bedrock-style tool calls (which use input instead of function.arguments),
this prevents tool_call.get("input", {}) from ever being evaluated.

Minimal fix:
Remove the default "{}" so None falls through correctly:

func_args = func_info.get("arguments") or tool_call.get("input", {})

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.arguments is missing or falsy.

Overview
Fixes native tool-call argument extraction in CrewAgentExecutor._handle_native_tool_calls by removing the default "{}" value for function.arguments, allowing the logic to correctly fall back to Bedrock-style tool_call.input when function.arguments is 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.

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.
@amabito
Copy link
Author

amabito commented Feb 21, 2026

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.

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