Skip to content

Not found tool execution brakes down the session. #2204

@aligokalppeker

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions