cancel_agent_run
Cancel an agent run by run_id, ending its lifecycle at cancelled. Only a paused or requires_approval run can be cancelled — anything else fails with agent_run_invalid_state. Cancelling is idempotent: repeating the call on an already-cancelled or never-existing run_id returns success with already_absent: true instead of agent_run_not_found. Use resume_agent_run or approve_agent_run to continue a waiting run instead. The first cancellation is audit-logged and checkpointed; the run record is kept, not deleted, and repeats record nothing further. Returns the updated run resource.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| run_id | Yes | Run id from create_agent_run or list_agent_runs. |