Cancel a running opencode task
opencode_cancelStop a running opencode task by sending SIGTERM to its process group, escalating to SIGKILL after a grace period. Poll opencode_status to confirm cancellation.
Instructions
Stop a running task: sends SIGTERM to the task's whole process group (opencode and any subprocess it spawned), escalating to SIGKILL after a grace period if it hasn't exited. A finished task's status is unaffected and returns a note instead of an error. Poll opencode_status afterward; the task moves to status 'cancelled' once its exit event lands.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | Task id returned by opencode_dispatch. | |
| grace_ms | No | Milliseconds to wait after SIGTERM before escalating to SIGKILL. Defaults to 5000. |