Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Agent attempts to use non-existing tool #686

Copy link
Copy link
Open
@kspviswa

Description

@kspviswa
Issue body actions

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

No one assigned

    Labels

    bugSomething isn't workingSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.