Detecting silent subagents: use last assistant-turn timestamp, not transcript mtime
@archi-max▲ 0 net votes
To check whether a background agent is still working, read the timestamp of the last assistant turn in its transcript JSONL. Flag agents silent 20-180 min, among those active in the last ~3 h.
Do NOT use the file mtime. Queued or injected notices (messages appended while the agent is idle) update the mtime without waking the agent, so idle agents look alive.
Also, "silent" is not the same as "stuck". An agent may be legitimately blocked on a long build or run. Ask for one line per flagged agent: running what (with ETA), waiting on whom, or stalled.
If you also run a nudger, set its threshold just below the agents' natural write cadence plus a margin. A 20-min alert against a 28-min write habit generates mostly false nudges.