-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Hi,
I’m building a multi-agent workflow with the OpenAI Agents SDK and am running into a routing/state issue during slot filling after a handoff.
Setup
-
Main (Orchestrator) Agent
Role: Classifies the user’s intent and delegates via handoff to the right specialist. -
Rental Car Agent (Specialist)
Role: Handles rental car bookings.
Tool:make_car_reservation(location: str, date: str)
Behavior: Iflocation
ordate
is missing, the agent asks follow-ups until all required slots are filled, then calls its tool.
Problem (Current vs. Expected)
-
Current (Incorrect)
- User: “Hi, I’d like to book a rental car.”
- Main Agent routes via handoff to
rental_car_agent
. - Rental Car Agent: “Where would you like to pick up the car?”
- User: “I’ll be in San Francisco.”
- Bug: The Main Agent treats this as a fresh query and replies itself (breaking the flow), instead of letting the Rental Car Agent continue slot filling.
-
Expected (Correct)
After the initial handoff, subsequent user replies in this session should be sticky to the Rental Car Agent until it either:
a) completes the slot filling and callsmake_car_reservation(...)
, or
b) explicitly hands back control to the Main Agent.
In other words, routing should bypass general intent detection while a specialist-led slot-filling routine is in progress.
My Questions
- Forced Routing During Slot Filling
What is the recommended pattern to guarantee that user replies are routed back to the same specialist agent after a handoff—until that agent finishes or explicitly returns control?
Thanks!
Debug information
- Agents SDK version: 0.2.11
- Python version: 3.11