Lifecycle

Stop, abort, retry, and stale responses

Stop pending announcements when a response is cancelled, and ignore late updates from an older retry.

Stopping a response clears pending text

Send response.interrupted when your app stops a response. Core discards waiting text and prepares a short status update. Adapters do not treat a generic ready state as proof that someone stopped a response.

Tell the runtime when a retry starts

response.retrying cancels the current attempt. Keep one responseId for the logical answer and give each attempt a new responseInstanceId. Core ignores late updates from older attempts.

typescript
runtime.dispatch({
  type: "response.retrying",
  responseId: "report",
  responseInstanceId: "attempt-1",
  nextResponseInstanceId: "attempt-2",
  attempt: 2,
});

How this code works

  1. 01
    Identify the replaced attempt

    responseInstanceId names the active attempt that is being cancelled.

  2. 02
    Name the new attempt

    nextResponseInstanceId becomes the accepted attempt for later text and final events.

  3. 03
    Keep the response ID

    responseId stays the same so the app can treat both attempts as one logical answer.