Immutable solution version
[BUG] Regression in CrewAI 1.9.3: custom BaseTool wrapper around BedrockKBRetrieverTool gets called without args (_run()
Complete solution
CrewAI: Reporter abdullahshahin's drive-by diagnosis: the tool-call args extraction fails before _run is reached, so query arrives as {} and the agent retries forever (watch for the tool_usage_finished-closing-flow_started pairing warning as the signal). If the wrapper subclasses BaseTool and overrides __init__, args_schema can be shadowed by Pydantic field resolution in 1.9.x - declaring args_schema on the subclass and re-passing it via
The problem
Issue crewAIInc/crewAI#4495 (closed, 30 comments): ### Description After upgrading CrewAI from 1.6.1 → 1.9.3, a custom tool wrapper around BedrockKBRetrieverTool no longer receives its required query argument. The tool call fails with: • ParsedBedrockKBRetrieverTool.run() missing 1 required positional argument: 'query' …and the agent repeatedly attempts to use the tool, effectively entering an infinite tool-calling loop. In crewai==1.6.1, the same code and workflow work as expected. The logs also show an events mismatch warning during the loop: [CrewAIEventsBus] Warning: Event pairing mismatch. 'toolusagefinished' closed 'flowstarted' (ex
The verified fix
Reporter abdullahshahin's drive-by diagnosis: the tool-call args extraction fails before run is reached, so query arrives as {} and the agent retries forever (watch for the toolusagefinished-closing-flowstarted pairing warning as the signal). If the wrapper subclasses BaseTool and overrides init, argsschema can be shadowed by Pydantic field resolution in 1.9.x - declaring argsschema on the subclass and re-passing it via super().init(args_schema=KBQueryInput) restores arg parsing.
Evidence
In gh:crewAIInc/crewAI#4495 (https://github.com/crewAIInc/crewAI/issues/4495), someone reported: Issue crewAIInc/crewAI#4495 (closed, 30 comments): ### Description After upgrading CrewAI from 1.6.1 → 1.9.3, a custom tool wrapper around BedrockKBRetrieverTool no longer receives its required query argument. The tool call fails with: • ParsedBedrockKBRetrieverTool.run() missing 1 required positional argument: 'query' …and the agent repeatedly attempts to use the tool, effectively entering an infinite tool-calling loop. In crewai==1.6.1, the same code and workflow work as expected. The logs also show an events mismatch warning during the loop: [CrewAIEventsBus] Warning: Event pairing mismatch. 'toolusagefinished' closed 'flowstarted' (ex The verified resolution from the thread: Reporter abdullahshahin's drive-by diagnosis: the tool-call args extraction fails before run is reached, so query arrives as {} and the agent retries forever (watch for the toolusagefinished-closing-flowstarted pairing warning as the signal). If the wrapper subclasses BaseTool and overrides init, argsschema can be shadowed by Pydantic field resolution in 1.9.x - declaring argsschema on the subclass and re-passing it via super().init(args_schema=KBQueryInput) restores arg parsing.
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_tPa7balrss4vv9v0ah68LQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">[BUG] Regression in CrewAI 1.9.3: custom BaseTool wrapper around BedrockKBRetrieverTool gets called without args (_run() <span>— Vectle</span></a>