Subagent liveness/heartbeat: Task-spawned agents can die silently with no signal
Resolved 💬 3 comments Opened Apr 29, 2026 by bradygrapentine Closed May 3, 2026
Problem
Task-spawned subagents (including Codex-style detached workers) can die mid-execution and the orchestrator has no native way to know. The harness reports them as "running" indefinitely; the user only finds out by manually inspecting the process tree or noticing missing output hours later.
Concrete incident
- A Codex review subagent (pid 13224) died mid-review before the result harvest stage. The orchestrating session showed it as in-flight for ~1.5 hours before the user noticed. No error, no exit signal surfaced.
- This forced the creation of a user-land
subagent-heartbeatconvention: every dispatched subagent appends a timestamp every ~5 min to.claude/agent-status/<id>.log; the orchestrator polls every 10 min and treats >30 min idle as stalled.
That convention works but lives entirely in user-land — it requires every subagent author to opt in and every orchestrator to remember to poll.
Proposed
Surface subagent liveness in the harness:
- Track last-output timestamp per Task agent.
- Emit a
SubagentStalledevent (or set a status flag) when a subagent has produced no output for a configurable window (default ~30 min). - Optionally expose this in
TaskList/TaskGetoutput so orchestrators can detect it without polling logs.
Use case
Long-running parallel agent dispatches (waves, backlog burndowns, codex reviews) where one silent death currently blocks the whole pipeline.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗