Files
hermes-agent/tests/tools
unsupportedpastels 01a6654bc1 fix(delegation): a stuck child a watchdog stopped is a failure, not a user stop
Both watchdogs end a stuck child with the cooperative stop /stop uses. A child that
unwound inside the grace window reported status=interrupted with the exit_reason a
user stop has, so delegation_wakes_parent treated it as a stop someone asked for and
its unviewed parent got a note. Only a child that ignored the stop reached
timeout/stalled and woke the parent.

- Heartbeat stale verdict (await_child): a result collected in the grace window
  that is interrupted is marked, and _build_result_entry reports it as the timeout
  it is (status and exit_reason "timeout", the stale-threshold error), keeping the
  partial output as the summary. A child that finished its answer in the window is
  still collected as completed.
- Async stall monitor: a unit whose runner returns while the record is "stalling"
  gets the same stall_* context on its event that a force-finalized stall carries. The
  children stay "interrupted"; delegation_wakes_parent counts an interrupted or
  cancelled child as a failure when the event has that context, and the batch
  block tells the parent the unit was stuck, not stopped.

A stop from the user or the parent carries neither mark and stays a note.

Found in review by @yoniebans.
2026-11-10 10:48:50 -05:00
..