Cancel an agent run
Changed onRequest cooperative cancellation of the durable agent run identified by run_id in the JSON body. Requires ownership, current agent access, and the agents.run scope. Sending a cancellation signal does not itself change an active run from RUNNING; poll GET run for the final state. Paused runs become CANCELLED without resuming execution. Repeated requests and requests for terminal runs return the current snapshot. Completion may win a race with cancellation. Completed tool side effects cannot be undone, and external work may continue if a tool does not support cancellation. Cancellation targets this run, not separate background-subagent executions. An active run without a cancellation registration returns 409. Cancellation signaling requires Redis. An interrupted active run can instead become FAILED through deadline cleanup; this does not verify that external tool work has stopped.
Request
- Base URL: https://instance-name-be.glean.com
- URL: https://instance-name-be.glean.com/api/agents/{agent_id}/cancellations
- Auth: HTTP bearer
Path parameters
ID of the agent that owns the run.
Request body
Example request
{
"run_id": "{run_id}"
}Response
Current run snapshot after requesting cancellation, or an unchanged terminal run.
Changes
- info
endpoint added
- info