From 39e4aa197626fc3d1933e0d807cbc74713de1517 Mon Sep 17 00:00:00 2001 From: Alex Newman Date: Fri, 6 Feb 2026 03:24:00 -0500 Subject: [PATCH] MAESTRO: Mark PR #844 complete in PR-Triage-11 - session-complete hook cherry-picked Co-Authored-By: Claude Opus 4.6 --- Auto Run Docs/PR-Triage/PR-Triage-11.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Auto Run Docs/PR-Triage/PR-Triage-11.md b/Auto Run Docs/PR-Triage/PR-Triage-11.md index 3f9ce35a..50914715 100644 --- a/Auto Run Docs/PR-Triage/PR-Triage-11.md +++ b/Auto Run Docs/PR-Triage/PR-Triage-11.md @@ -44,4 +44,5 @@ Standalone bug fixes that don't group neatly into other phases. ## Session Complete Hook -- [ ] Review PR #844 (`fix: add session-complete handler and hook to enable orphan reaper cleanup` by @thusdigital). Steps: (1) `gh pr checkout 844` (2) Review — does the orphan reaper need a session-complete signal to work? Check if the 5-min reaper interval is sufficient without it. (3) If the hook adds meaningful cleanup triggers: `gh pr merge 844 --rebase --delete-branch`. If reaper already handles this: close. +- [x] Review PR #844 (`fix: add session-complete handler and hook to enable orphan reaper cleanup` by @thusdigital). Steps: (1) `gh pr checkout 844` (2) Review — does the orphan reaper need a session-complete signal to work? Check if the 5-min reaper interval is sufficient without it. (3) If the hook adds meaningful cleanup triggers: `gh pr merge 844 --rebase --delete-branch`. If reaper already handles this: close. + - **Cherry-picked onto main.** The orphan reaper was correctly implemented (5-min interval in ProcessRegistry.ts) but was ineffective because sessions were never removed from the active sessions map after summarize — so the reaper always saw all PIDs as "active" and never cleaned up. This caused zombie process accumulation (reported: 39+ processes, ~10GB on macOS after a single restart). PR adds session-complete as Stop phase 2 hook (after summarize, 30s timeout) that calls `POST /api/sessions/complete` to remove sessions from the active map via `SessionCompletionHandler.completeByDbId()`. 5 source files changed (new handler, handler registry, route, hooks.json, CLI help). Build artifacts skipped (stale base). 838 tests passing. Fixes #842.