Skip to content

Built-in Support for Sticky Session Routing / Direct Agent Handoff #1436

@Mukish45

Description

@Mukish45

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions