Files
hermes-agent/tools
teknium1 e2e2a2fb43 fix(process): kill children a SIGTERM-ignoring background shell spawns during the grace window
Background jobs run under an interactive `bash -lic` wrapper, which ignores SIGTERM.
_terminate_host_pid snapshotted the tree once, BEFORE the grace windows; the shell kept
running its script through both windows, and every child it started meanwhile was
reparented to init when the shell was finally SIGKILLed -- while kill_process reported
"killed" and the post-kill survivor check (#115490) only re-probed the stale snapshot.

Deterministic repro: spawn_local('sleep 1; for i in 1 2 3; do sleep 3600 & done; wait')
and kill it within the first second -> 3 orphaned sleeps every time. Found by
tests/e2e/core/chaos (tool_background_swarm flaked under load, and
tool_background_spawns_while_killed is red without this).

Re-snapshot the descendants while the parent is still alive, right before escalation.
2026-09-23 06:01:37 -07:00
..