Symptom
After a prepare_tools callback returns None, the agent runs with zero tools and answers in prose, with no exception, log or trace entry.
Evidence what you'll see
- The model stops making tool calls
- Nothing in tracing shows the tools were removed
- Agent(prepare_tools=None) keeps every tool, which makes the two easy to confuse
Cause
Returning None from a registered prepare callback means no tools for that step, the opposite of passing prepare_tools=None to the agent, and nothing warned about it.
Fix steps
0 of 2 done
Your check marks stay in this browser only.
Verify the fix worked
- Run the agent and confirm the model can call its tools and no UserWarning about prepare callbacks appears.
Sources and credit
Summarized in our own words from these public reports. Credit goes to their authors.
Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change
Hit an error we don't cover? Submit it