A run may wait for a decision, approval, credential, or other input. Waiting is an explicit terminal event for the current run, not an inferred timeout.
Resume the same work
Read the waiting result's durable interaction request ID and answer it on the same session:
const terminal = await agent.resume(
{
sessionId: "reference-session-001",
requestId: waitingRequestId,
message: "Approved. Continue with the requested operation.",
},
context,
);sessionId, requestId, and message are required. The SDK marks the turn as
a response to the blocked run and carries the request ID into the Execution
Protocol. Validate browser input and authorize the requested action before
calling resume().
Use resumeStream() with the same fields when the resumed work should stream.
Cancellation
Pass an AbortSignal to stream() or resumeStream() for request-scoped work.
When the caller disconnects, the SDK cancels that exact upstream run and the
terminal promise resolves with run.cancelled.
Cancellation remains in history as its own terminal outcome. It is not a generic failure and does not erase earlier events.