Skip to content

fix: resolve empty arguments for Bedrock native tool calls#5158

Open
IgnazioDS wants to merge 1 commit intocrewAIInc:mainfrom
IgnazioDS:fix/bedrock-tool-call-args
Open

fix: resolve empty arguments for Bedrock native tool calls#5158
IgnazioDS wants to merge 1 commit intocrewAIInc:mainfrom
IgnazioDS:fix/bedrock-tool-call-args

Conversation

@IgnazioDS
Copy link
Copy Markdown

@IgnazioDS IgnazioDS commented Mar 28, 2026

Summary

  • Fix _parse_native_tool_call to correctly read Bedrock tool arguments
  • The or-chain fallback was broken because get("arguments", "{}") returns a truthy default, preventing fallthrough to tool_call.get("input") where Bedrock places arguments

Problem

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

# Before (broken)
func_info.get("arguments", "{}") or tool_call.get("input", {})

# After (fixed)  
func_info.get("arguments") or tool_call.get("input") or "{}"

Test plan

  • Verify OpenAI-format tool calls still parse correctly
  • Verify Bedrock-format tool calls now receive proper arguments
  • Verify fallback to "{}" works when neither key is present

Fixes #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_call so dict-style calls (notably AWS Bedrock) correctly fall back from function.arguments to the top-level input payload instead of always defaulting to an empty {}.

Written by Cursor Bugbot for commit fd2d040. This will update automatically on new commits. Configure here.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant