Inspect a queue
active_turn_ids identifies running turns. It does not contain response IDs.
Submit tasks through responses or run a plan to add work to the queue.
Pause, edit, and resume
setHalted returns updatedCount and an optional dispatch result.
Steps within a plan retain their required order.
Queued messages from the user dispatch first.
Retrieve the queue after reordering to read its
effective order.
Reorder, edit, and cancel return
{ success }.
If a turn starts before your edit, retrieve the queue again.
Use responses.cancel to cancel the task, or runs.cancel to cancel a generation run.
Read dispatch results
A successful HTTP request can return
promoted: false.
Inspect the queue for running work, approval holds, or a halted state.
A queue change can succeed while its dispatch attempt fails.
In that case, retrieve the queue before calling queue.dispatch again.
Release an approval hold
SetrequiresApproval to false to release a queued continuation’s hold:
requiresApproval: true to add a hold.
A false value can dispatch work immediately.
If updated is false, the turn can have started or been cancelled. Retrieve the queue again.
approveCheckpoints: true also approves the relevant plan checkpoints and can release related continuations.
Prefer response approvals when responding to response.pending_inputs.
Inspect a generation run
For an operation withkind: "generation", use its id as the run ID. Pass its owning conversation ID as the second argument.
operation, available artifacts, and cost approval input_requests.
The operation includes its status, artifact IDs, optional progress, and an error when it fails.
A failed run can still have useful artifacts.
Retry a generation
A retry creates another generation attempt and can incur charges.mediaId, runId, attempt, requestId, and optional approvalRequired.
Use the returned run ID to inspect the attempt.
If it requires approval, retrieve the run and answer its pending input request.
Answer a cost approval
Use the input request ID from the retrieved run.reject to decline. The decision applies to the request’s approval group, which can contain multiple generations.
The result contains optional counts. Missing counts are not evidence of zero work.
On 409, retrieve the run again and use the current input request for the next decision.
Cancel a run
cancelled: false does not confirm that the provider stopped.
If the run is still generating, retrieve its latest state and retry cancellation.
Queue and run methods accept optional signal and timeoutMs options.
Writes are sent once and are not retried automatically.
After an uncertain retry or approval, retrieve the run before sending another request.
See errors and troubleshooting for request failures and execution failures.