- Steering: The run records the message in its history as a user message, with the steering text in a JSON note. With a
conversation, the run saves the message as described in Saving progress. The model receives it in the next step, after the current tool calls finish. A runningrun_programcall doesn’t delay it: the program continues in the background, and the model receives its result in a later step. Steering doesn’t undo tool calls that already started. A message that the run accepts during a model call discards that call’s response, and the run asks the model again in a new step, which counts towardmaxSteps. - Interruption: The run cancels unfinished tool calls and the child invocations of
handlerTool,serviceTool, andawaitChild, and returns{status: "interrupted", reason, output}, with a summary inoutput, unless the agent setsfinalize: false.
chat handler stores its invocation ID in state, so steer and interrupt can read which invocation to signal. It clears the ID in finally, so a failed run leaves no stale ID behind.
Interrupting a run is different from cancelling the invocation: cancellation fails the handler instead of returning a result. See Error handling.
To check or redact steering messages before the run uses them, add a beforeSteering guardrail.
To control the run from your own code instead of signals, pass controls: {steering, interrupt} to run. steering is a function that returns a future for the next message, and interrupt is a future that resolves to the reason.