Open
Description
Describe the question
I have a main agent with hand offs to sub agent. However if no hand off matches, the main agent is suppose to answer the query. But it appears to always look for tools which doesn't exist.
main_agent = Agent(
name = "Operator Agent",
instructions="You determine which agent to use based on the user's question. If the question is about customer accounts, credit cards, or wire transfers, hand off to the appropriate agent. Otherwise, answer the question yourself.",
model = OllamaProviderAsync().get_model(),
handoffs=[accounts_agent, credit_card_agent, wire_transfer_agent],
model_settings=ModelSettings(tool_choice="none")
)
For input who is the president of usa
, main_agent
is trying to invent a tool called get_US_A PresidentialInformationService
.venv/lib/python3.13/site-packages/agents/_run_impl.py", line 405, in process_model_response
raise ModelBehaviorError(f"Tool {output.name} not found in agent {agent.name}")
agents.exceptions.ModelBehaviorError: Tool get_US_A PresidentialInformationService not found in agent Operator Agent
Potential RC
As per this, the code assumes if not hand_off, it has to be other tool. Setting model_settings=ModelSettings(tool_choice="none")
doesn't help either.
Debug information
- Agents SDK version: v0.0.14
- Python version v3.13.1
Repro steps
Refer above
Expected behavior
There should be a way to let the agent know not to use a tool if it is not specified.
Metadata
Metadata
Assignees
Labels
Something isn't workingSomething isn't working