Skip to content

Not found tool execution brakes down the session. #2204

Closed

Description

@aligokalppeker

Describe the bug

For the OpenAI Realtime model, when the model hallucinates a tool that is not hooked into the tool list, and platforms SDK fails and raises an exception, causing teardown of the session.

Tool hallucination is very likely to happen in complex prompts, as well as OpenAI's text mode.

Made-up tool errors are also opened with other bugs but closed due to inactivity; #1671

Debug information

  • Agents SDK version: v0.6.3
  • Python version: Python 3.11

Repro steps

  • Add a system instruction for a made-up or non-existent tool. (also a tool name similar but not an exact one of the one added to the system)
  • During the execution, when the tool fails exception is raised, the following log is raised, and the whole session is down.

``agents.exceptions.ModelBehaviorError: Tool xxxx not found.

Expected behavior

As the tool fails, this error can be logged and propagated as a message or handler, allowing the session to continue with the error handled by the application.

Activity

  1. added
    bug
    on Dec 18, 2025
  2. sandsc commented on Dec 19, 2025

    @sandsc

    Having same issue too

  3. aligokalppeker commented on Dec 24, 2025

    @aligokalppeker
    ContributorAuthor

    Any updates about this bug @seratch , any plan to fix or improve this?

  4. added a commit that references this issue on Dec 28, 2025
    d713fdd
  5. added a commit that references this issue on Jan 6, 2026
    c35c0af
  6. Grantward1 commented on Feb 4, 2026

    @Grantward1

    I have a particular agent which is constantly making up tools. I have explicitly set it to not use tools: 'model_settings' = agents.ModelSettings(tool_choice='none')

     An error occurred while running the tool. Please try again. Error: Tool repo_browser.create_file not found in agent Command Display Agent
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfeature:realtime

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions