## Problem The deacon patrol was leaking claude processes. Every patrol cycle (1-3 minutes), a new claude process was spawned under the hq-deacon tmux session, but old processes were never terminated. This resulted in 12+ accumulated claude processes consuming resources. ## Root Cause In molecule_step.go:331, handleStepContinue() used tmux respawn-pane -k to restart the pane between patrol steps. The -k flag sends SIGHUP to the shell but does not kill all descendant processes (claude and its node children). ## Solution Added KillPaneProcesses() function in tmux.go that explicitly kills all descendant processes before respawning the pane. This function: - Gets all descendant PIDs recursively - Sends SIGTERM to all (deepest first) - Waits 100ms for graceful shutdown - Sends SIGKILL to survivors Updated handleStepContinue() to call KillPaneProcesses() before RespawnPane(). Co-authored-by: Roland Tritsch <roland@ailtir.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
11 KiB
11 KiB