Brennan Benson
40548e5dd6
fix(terminal): kill agent descendant processes on session teardown (STA-1800)
...
Agent CLIs spawn tool children in detached process groups that PTY
SIGHUP can never reach. Killing an agent session (tab close, retire,
sleep) left those children running as orphans — eight orphaned git
processes burned ~8 cores for up to 11.5h under the agents-running
keep-awake and drained a battery to 8%.
New pty-descendant-termination module: snapshot the ppid tree BEFORE
signalling (a dead root's descendants reparent to pid 1 and become
unfindable), SIGTERM the root group and every descendant, then after a
2s grace SIGKILL survivors gated on a pid+start-time identity re-check
so a recycled pid is never signalled. Snapshot is bounded and never
rejects; failures degrade to today's shell-only kill.
Wired for agent sessions only (plain terminals keep nohup semantics) at
all three POSIX kill sites: local provider shutdown, daemon
TerminalHost immediate kill (the pty:kill path — force-kill bypassed
Session.kill entirely), and daemon Session graceful kill.
Verified live in the built app: an agent pane with a detached-pgid
child; the child survived on the unwired build (three control runs) and
dies within ~5s with the fix. Windows ConPTY and SSH-hosted PTYs keep
the previous foreground-tree contract (documented follow-ups).
2026-07-14 02:05:25 -07:00
..
2026-07-13 16:36:59 -07:00
2026-07-14 00:15:34 -07:00
2026-07-12 01:40:39 -07:00
2026-07-06 02:12:32 -07:00
2026-06-29 22:38:29 -07:00
2026-07-14 02:05:25 -07:00
2026-07-13 00:48:51 -07:00
2026-07-13 19:13:19 -07:00
2026-06-29 22:38:29 -07:00
2026-06-10 17:23:12 -07:00
2026-06-19 17:14:55 -07:00
2026-06-11 12:46:43 -07:00
2026-07-13 00:48:51 -07:00
2026-07-10 17:27:47 -07:00
2026-07-10 17:27:47 -07:00
2026-07-10 17:27:47 -07:00
2026-07-12 22:40:57 -07:00
2026-06-07 18:16:53 -07:00
2026-07-05 21:51:32 -07:00
2026-06-08 01:00:29 -07:00
2026-07-13 00:48:51 -07:00
2026-06-28 23:13:03 -07:00
2026-06-29 22:38:29 -07:00
2026-06-29 23:37:30 -07:00
2026-07-12 16:30:44 -07:00
2026-07-13 00:48:51 -07:00
2026-06-07 17:49:01 -07:00
2026-06-07 17:49:01 -07:00
2026-06-07 17:49:01 -07:00
2026-06-29 22:38:29 -07:00
2026-06-17 20:05:55 -07:00
2026-06-29 22:38:29 -07:00
2026-06-29 22:38:29 -07:00
2026-06-29 22:38:29 -07:00
2026-05-13 18:48:14 -07:00
2026-05-13 18:48:14 -07:00
2026-05-30 22:46:38 -07:00
2026-05-30 22:46:38 -07:00
2026-07-06 02:12:32 -07:00
2026-06-19 17:14:55 -07:00
2026-05-25 22:21:39 -07:00
2026-04-27 20:55:47 -07:00
2026-06-22 16:27:33 -07:00
2026-06-09 20:57:43 -07:00
2026-06-10 13:41:05 -07:00
2026-06-29 22:38:29 -07:00
2026-06-29 22:38:29 -07:00
2026-06-29 22:38:29 -07:00
2026-07-05 19:46:49 -07:00
2026-07-10 17:27:47 -07:00
2026-07-10 17:27:47 -07:00
2026-06-29 22:38:29 -07:00
2026-07-13 19:41:24 -07:00
2026-06-29 22:38:29 -07:00
2026-06-29 22:38:29 -07:00
2026-07-09 22:33:55 -07:00
2026-05-25 16:43:22 -07:00
2026-07-04 23:29:05 -07:00
2026-06-22 12:29:18 -07:00
2026-07-13 12:45:46 -07:00
2026-05-19 00:28:55 -07:00
2026-07-09 00:46:03 -07:00
2026-07-09 02:13:13 -07:00
2026-07-05 19:46:49 -07:00
2026-07-05 21:51:32 -07:00
2026-07-12 22:40:57 -07:00
2026-06-29 22:38:29 -07:00
2026-07-10 17:27:47 -07:00
2026-07-12 22:40:57 -07:00
2026-05-21 01:19:49 -04:00
2026-06-29 22:38:29 -07:00
2026-07-05 19:46:49 -07:00
2026-06-29 22:38:29 -07:00
2026-06-02 22:31:57 -07:00
2026-07-06 02:12:32 -07:00
2026-06-10 21:14:53 -07:00
2026-07-05 19:46:49 -07:00
2026-07-05 19:46:49 -07:00
2026-06-20 18:47:39 -07:00
2026-06-16 18:56:52 -07:00
2026-07-10 22:43:12 -07:00
2026-06-29 22:38:29 -07:00
2026-07-04 22:56:55 -07:00
2026-06-22 16:42:20 -07:00
2026-06-22 16:42:20 -07:00
2026-07-11 03:20:55 -07:00
2026-06-22 16:42:20 -07:00
2026-06-22 16:42:20 -07:00
2026-07-12 23:50:00 -07:00
2026-07-12 23:50:00 -07:00
2026-07-11 03:20:55 -07:00
2026-07-11 03:20:55 -07:00
2026-07-10 17:27:47 -07:00
2026-07-05 21:51:32 -07:00
2026-06-19 17:14:55 -07:00
2026-06-10 21:14:53 -07:00
2026-05-16 11:50:26 -07:00
2026-06-25 18:36:11 -07:00
2026-06-18 00:11:32 -07:00
2026-06-18 00:11:32 -07:00
2026-06-29 22:38:29 -07:00
2026-07-12 22:40:57 -07:00
2026-05-25 15:07:40 -07:00
2026-06-08 01:00:29 -07:00
2026-06-30 15:29:12 -07:00
2026-07-05 21:51:32 -07:00
2026-06-20 02:03:24 -07:00
2026-06-10 21:14:53 -07:00
2026-06-19 19:43:42 -07:00
2026-06-17 10:49:41 -07:00
2026-07-10 21:00:31 -07:00
2026-07-10 19:50:44 -07:00
2026-07-10 17:27:47 -07:00
2026-07-13 01:10:38 -07:00
2026-07-12 22:40:57 -07:00
2026-06-09 13:52:58 -07:00
2026-06-19 17:14:55 -07:00
2026-06-24 20:16:14 -07:00
2026-07-10 17:27:47 -07:00
2026-07-10 17:27:47 -07:00
2026-06-20 01:27:41 -07:00
2026-06-20 01:27:41 -07:00
2026-06-27 09:30:29 -07:00
2026-07-06 02:12:32 -07:00
2026-07-12 22:40:57 -07:00
2026-06-21 23:09:01 -07:00
2026-07-14 00:15:34 -07:00
2026-07-12 11:48:17 -07:00
2026-07-11 15:02:46 -07:00
2026-06-24 20:16:14 -07:00
2026-06-20 02:03:24 -07:00
2026-06-20 02:03:24 -07:00
2026-06-20 02:03:24 -07:00
2026-07-13 00:48:51 -07:00
2026-06-22 16:42:20 -07:00
2026-07-10 17:27:47 -07:00
2026-07-13 00:48:51 -07:00
2026-06-22 16:42:20 -07:00
2026-07-06 02:12:32 -07:00
2026-07-06 20:17:35 -07:00
2026-07-13 14:17:49 -07:00
2026-06-23 00:23:34 -07:00
2026-07-13 16:36:59 -07:00
2026-07-13 00:48:51 -07:00
2026-07-10 17:27:47 -07:00
2026-06-19 17:14:55 -07:00
2026-07-10 17:27:47 -07:00
2026-06-23 00:23:34 -07:00
2026-06-23 10:15:06 -07:00
2026-06-23 00:23:34 -07:00
2026-07-05 21:51:32 -07:00
2026-07-05 21:51:32 -07:00
2026-06-12 16:31:24 -07:00
2026-06-22 16:42:20 -07:00
2026-07-13 21:30:10 -07:00
2026-06-19 17:14:55 -07:00
2026-05-15 23:52:37 -07:00
2026-06-07 17:49:01 -07:00
2026-06-29 22:38:29 -07:00
2026-05-17 15:43:53 -04:00
2026-06-18 00:11:32 -07:00
2026-07-05 19:46:49 -07:00
2026-04-19 15:50:19 -07:00
2026-07-13 16:15:44 -07:00
2026-05-21 01:33:53 -07:00
2026-06-18 00:11:32 -07:00
2026-06-29 22:38:29 -07:00
2026-06-18 00:11:32 -07:00
2026-07-10 03:00:51 -07:00
2026-06-18 00:11:32 -07:00
2026-07-10 03:00:51 -07:00
2026-07-05 19:46:49 -07:00