Skip to content

fix: extract Bedrock tool call arguments from input field#4950

Open
themavik wants to merge 1 commit intocrewAIInc:mainfrom
themavik:fix/4748-bedrock-tool-args-empty
Open

fix: extract Bedrock tool call arguments from input field#4950
themavik wants to merge 1 commit intocrewAIInc:mainfrom
themavik:fix/4748-bedrock-tool-args-empty

Conversation

@themavik
Copy link

Summary

Fixes #4748.

Root cause: In crew_agent_executor.py, func_info.get("arguments", "{}") or tool_call.get("input", {}) always evaluates to "{}" (a truthy string) when the arguments key is absent, so the or branch that checks tool_call["input"] never runs. AWS Bedrock places tool call arguments in the input field, not arguments.

Fix: Changed to func_info.get("arguments") or tool_call.get("input") or {} — matching the already-correct pattern in agent_utils.py line 1224.

Changes

  • lib/crewai/src/crewai/agents/crew_agent_executor.py: Removed default "{}" from get("arguments") so falsy None falls through to the input field check.

Testing

  • Verified fix matches the existing correct pattern in agent_utils.py
  • Change is minimal (1 line) and backward-compatible
  • OpenAI-style tool calls (with arguments key) continue to work

Made with Cursor

…4748)

Root cause: func_info.get("arguments", "{}") returns the default "{}" (truthy string) when the key is absent, preventing the or-branch from checking tool_call["input"] where Bedrock places arguments.

Made-with: Cursor
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.

[BUG] AWS Bedrock tool calls extract empty arguments - uses wrong field name

1 participant