This repository was archived by the owner on Jun 8, 2026. It is now read-only.
Conversation
- Kill process groups (-pid) instead of single PID in plan-loop cancel so pipeline children (grep, tee, claude) do not survive as orphans - Update JobStore in handleLoopKill with CANCEL_PENDING before deleting from runningLoops, so killed jobs show CANCELLED instead of FAILED - Add three cancellation gates in handleProcessCompletion success path to prevent git/PR work and completed events after cancel - Track attemptLlmCommit child PID in runningLoops, JobStore, and on-disk process.pid so cancel and status routes see the live process - Wrap post-processing in try/finally to prevent stale runningLoops entries that block future launches - Add restart-aware fallback in handleLoopKill: when runningLoops is empty (post-restart), fall back to JobStore PID for cancellation - Plumb JobStore into symphony-kill routes so legacy kill endpoint immediately upserts STOPPED status instead of waiting for enrichment - Suppress terminal status from state.json when process is still alive in both enrichJobSnapshot and resolveEffectiveState - Export getActiveLoopPid for plan-loop cancel PID fallback chain Testing: - 339 tests pass (19 new), typecheck and lint clean - New unit tests for shouldApplyStateStatus and enrichJobSnapshot integration with state.json status/phase suppression - New integration tests for kill JobStore update, restart-fallback cancel via loop/kill and plan-loop cancel, and status endpoint terminal status normalization - New cancellation gate tests for cancel before/during LLM commit and non-zero exit with CANCEL_PENDING Risks: - Cancellation gates add early returns in handleProcessCompletion; artifacts may not be uploaded if cancelled mid-processing (intended) - Process group kill (-pid) requires detached spawn (already the case)
mikeangstadt
approved these changes
Mar 25, 2026
Code Review SummaryStatus: Needs Attention Reviewers: Bug Hunter A, Bug Hunter B, Unified Auditor, Premise Reviewer, gateway-core-architect Findings
HIGH Issues (should fix)
MEDIUM Issues (consider)
Validation Stats
Recommendation: Address the two HIGH issues before merging. Both are race conditions in the cancel/kill lifecycle. |
Replace waitForPidChange (polling JobStore for PID update) with a marker-file signal from the fake claude binary. The fake script touches a marker file on entry, and the test polls for that file to detect when attemptLlmCommit has been entered. This is deterministic regardless of PID update timing. Testing: - 339 tests pass locally - Removed unused waitForPidChange helper
thadeusb
approved these changes
Mar 25, 2026
- Move CANCEL_PENDING upsert before SIGTERM in handleLoopKill so handleProcessCompletion sees cancellation intent when exit fires - Restart-fallback kill: track process liveness and use CANCELLED (with completedAt) when process was already dead, CANCEL_PENDING when it was alive and signals were sent - Extract markJobStopped helper in symphony-kill.ts to eliminate 4 identical jobStore upsert blocks Testing: - 339 tests pass, typecheck and lint clean
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Testing:
Risks: