-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
I am seeing a Tool not found exception after the agent handoff intermittently.
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/arklex/env/agents/openai_realtime_agent.py", line 413, in receive_events
async for event in self.session:
File "/usr/local/lib/python3.10/site-packages/agents/realtime/session.py", line 162, in __aiter__
raise self._stored_exception
File "/usr/local/lib/python3.10/site-packages/agents/realtime/openai_realtime.py", line 244, in _listen_for_messages
await self._handle_ws_event(parsed)
File "/usr/local/lib/python3.10/site-packages/agents/realtime/openai_realtime.py", line 584, in _handle_ws_event
await self._handle_output_item(parsed.item)
File "/usr/local/lib/python3.10/site-packages/agents/realtime/openai_realtime.py", line 442, in _handle_output_item
await self._emit_event(
File "/usr/local/lib/python3.10/site-packages/agents/realtime/openai_realtime.py", line 235, in _emit_event
await listener.on_event(event)
File "/usr/local/lib/python3.10/site-packages/agents/realtime/session.py", line 204, in on_event
await self._handle_tool_call(event)
File "/usr/local/lib/python3.10/site-packages/agents/realtime/session.py", line 451, in _handle_tool_call
raise ModelBehaviorError(f"Tool {event.name} not found")
agents.exceptions.ModelBehaviorError: Tool getProductCategories not found
The events fire before the exception -
Error in receive_events: Tool getProductCategories not found
agent_start: SalesAgent
audio_interrupted
agent_end: SalesAgent
raw_model_event audio_delta
agent_start: SalesAgent
agent_end: SalesAgent
handoff: AuthAgent -> SalesAgent
Wondering if anyone has seen this behavior before.
Debug information
- Agents SDK version: 0.2.10
- Python version: Python 3.10
Repro steps
This issue is hard to reproduce as its happening intermittently.
- Have two agents with their own set of tools
- Get to the agent handover
- Request a tool call
- The exception should be thrown
Expected behavior
Tool call to succeed without throwing an exception
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working