Skip to main content
Steering lets you redirect a long-running hosted agent while it’s still working. A new input queues behind the active turn and the running handler cooperatively winds down. This approach avoids rejecting the new turn or racing two turns at once.
Long-running agents are in preview. APIs and package versions are subject to change.

Turn on steering

Responses protocol

Set steerable_conversations=True on ResponsesServerOptions:
A second turn that arrives on a busy conversation queues and the current handler cooperatively cancels. This approach avoids returning 409 conversation_locked. Send the follow-up as a new response with previous_response_id set to the running response and the same agent_session_id.

Invocations and task primitives

Pass steerable=True to @multi_turn_task:
Without steerable=True, a concurrent .start() on an in-flight chain raises TaskConflictError.

Wind down the active turn

When something is queued, the framework signals the running handler through the cooperative cancel signal. A steerable handler should check for it at safe boundaries and return early so the queued turn can take over:
Steering observability on the context:

Order turns with a precondition

When a client reasons about message ordering, pass if_last_input_id so a stale caller can’t append after another caller has advanced the chain. It’s the input-queue equivalent of an HTTP If-Match:
If the chain’s last accepted input no longer matches, the call raises LastInputIdPreconditionFailed.

Handle a full queue

The steering queue is bounded. When it’s full, an enqueue raises SteeringQueueFull; surface a clear “please wait” signal to the user rather than dropping the input silently:
Steerable conversations are sequential, not forked: newer input can queue behind or interrupt the active turn, but the conversation still has one latest turn and one ordered history.