diagnose_task
Diagnose task state by analyzing heartbeat, logs, child PID, watcher, and artifacts. Returns conservative status with confidence and safe actions.
Instructions
v0.7.0: Diagnose a running or collecting_artifacts task using multi-signal evidence (heartbeat age, log freshness, child PID liveness, watcher ownership, artifact presence). Returns a conservative diagnosis (active_running, stale_running, possibly_stale_running, orphaned_running, artifact_collection_stuck, done_candidate, unknown, terminal) with confidence level and safe_actions. Never relies on a single signal; refuses to call PID-alive tasks 'active' when other signals are stale (PID reuse protection). Read-only — does not modify task state.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | Task ID to diagnose | |
| include_logs | No | When true, include redacted stdout/stderr tails in the output. Default false to keep output minimal. |