fix: kill child process tree on timeout + heartbeat step 4 (GAL-739)#10
Open
ADWilkinson wants to merge 2 commits intomainfrom
Open
fix: kill child process tree on timeout + heartbeat step 4 (GAL-739)#10ADWilkinson wants to merge 2 commits intomainfrom
ADWilkinson wants to merge 2 commits intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
exec.tsso aclaude -pgrandchild actually dies when the step timeout fires (root cause of the GAL-738 80+ min wedges).[4/8] Planning with Claude…line.planMinutesdefault from 60 to 90 to cover deep-mode plans on monorepos with 3000+ line target files.src/exec.test.tsasserts the grandchild-sleep scenario is cleaned up on Linux.Why
Two recent
oneshot --local --bgdispatches againstpersonal/galleonlabs-zkp2pstalled inside step 4 for 96 min and 3h52m. The childclaude -pprocess stayed alive becausekillProcessTreeonly signalled the top-level bash PID — the grandchild was reparented to PID 1 and kept burning CPU. Meanwhile, no log output was emitted after the step started, so the operator had no way to tell "still working" from "stuck". The 60-min default was also too tight for deep-mode plans that routinely run 40-80 min.Relates to GAL-739 and GAL-738.
Changes
src/exec.ts— process group killdetached: trueso the child gets its own process groupkillProcessTreefor both SIGTERM and the follow-up SIGKILLsrc/steps/plan.ts— heartbeatsetIntervalbefore awaitingexecOrThrowthat logs elapsed time and theplanMinuteslimit vialog.infofinallyblocksrc/config.ts— timeout bumpDEFAULT_STEP_TIMEOUTS.planMinutes: 60 → 90src/exec.test.ts(new)bash -c "sleep 30"through theexechelper with a 2s timeout, waits 6s, then asserts viapgrepthat no orphansleep 30process remainsTest plan
Not run — typecheck and test execution deferred to CI / operator verification. The spec commands are: