-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
In multi-agent conversational systems, it is often necessary to "lock" a conversation to a specific sub-agent after an initial routing decision, and keep routing all subsequent messages in that session directly to the same agent until an explicit reset/exit condition (e.g., user says "new task") is met. This is commonly referred to as a "sticky session" or "direct handoff" pattern.
Currently, the OpenAI Agent SDK does not provide out-of-the-box support for this routing mode:
- Each new user input is routed from scratch or requires custom logic for persistent handoff
- There is no built-in way to lock a session to a specific agent until a reset condition occurs
Desired Solution:
Provide an easy mechanism (e.g., an option or helper class) to enable sticky sessions, where the SDK will automatically direct all messages to the selected sub-agent after the initial routing, restoring control to the main router only on reset.
This pattern would reduce repetitive routing, improve continuity, and enable deeper multi-turn workflows with a single agent.