pub async fn stop_task(
task_id: &str,
context: &StopTaskContext,
) -> Result<StopTaskResult, StopTaskError>Expand description
Look up a task by ID, validate it is running, kill it, and mark it as notified.
Throws StopTaskError when the task cannot be stopped (not found,
not running, or unsupported type). Callers can inspect the error variant
to distinguish the failure reason.