orca/tests
Brennan Benson 40d0159926
fix(terminal): kill agent descendant processes on session teardown (STA-1800) (#8706)
* 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).

* fix(terminal): harden descendant teardown

* fix(terminal): require fresh process snapshots

* fix(terminal): close descendant teardown races

* refactor(terminal): preserve teardown line budget

* fix(terminal): keep descendant teardown fresh and identity-safe

* docs(reliability): record integrated descendant E2E

* fix(terminal): bound descendant teardown work

* fix(terminal): share descendant snapshot indexes

* docs(reliability): record descendant review evidence

* revert: remove speculative descendant hardening
2026-07-15 13:25:24 -07:00
..
e2e fix(terminal): kill agent descendant processes on session teardown (STA-1800) (#8706) 2026-07-15 13:25:24 -07:00
.gitignore feat: add idempotent E2E test suite with headless Electron support (#671) 2026-04-19 12:09:32 -07:00
playwright.config.ts Stabilize sharded e2e CI concurrency (#6312) 2026-06-24 18:39:02 -07:00