Delimit Agent Cancel
delimit_agent_cancelCancel a delegated task and terminate its live worker process, recording the reason and releasing its lock. Use when work is stuck, misguided, or no longer needed.
Instructions
Cancel a task and terminate its worker process if still alive.
When to use: to withdraw delegated work — a stuck or misguided worker, a duplicate dispatch, or a task the plan no longer needs. Records "cancelled" with the reason and signals the live worker (pid recorded at launch, cmdline-validated against the session id, with a pkill-by-session fallback). Cancellation and "uncertain outcome" stay distinct: cancelled tasks can never be closed via delimit_agent_complete — re-dispatch instead. When NOT to use: to close finished work (use delimit_agent_complete), to read state (use delimit_agent_status), or to transfer ownership (use delimit_agent_handoff).
Sibling contrast: delimit_agent_complete accepts and closes; this withdraws. delimit_agent_poll observes without changing the worker; this stops it.
Side effects: writes the cancellation via ai.agent_dispatch.cancel_task (status, reason, timestamp, and whether a live process was signalled) plus an audit entry, and releases any checkout lock the task holds.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reason | Yes | Why the task is cancelled. Required. | |
| task_id | Yes | Task id to cancel (AGT-xxx). Required. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||