Repository navigation
refactor(#1472): one killProcessGroup(child, { graceMs }) with SIGKILL escalation; pushLines on RingBuffer (closes the AsyncSubprocess trigger) - #1557
Merged
admarble merged 5 commits intoOct 19, 2026
Conversation
…L escalation; pushLines on RingBuffer src/lib/process-group.ts replaces the codex, opencode and MCP run.ts copies. Drivers escalate after DRIVER_SIGKILL_GRACE_MS and report a SIGKILL close after a requested kill as a timeout; run.ts keeps SIGKILL_GRACE_MS. RingBuffer gains a maxLineChars option and pushLines(text). Entire-Checkpoint: 65cc8854d44a
emptyCatch 119 -> 118 (three kill copies -> one); proseGate.lines +57 from the AC-2b block appended to opencode.test.ts, which already mentions SKILL.md. Entire-Checkpoint: 7d726196a1cc
…-drivers-mcp-one-killprocessgroup-child-gr # Conflicts: # scripts/qa/health-baseline.json
…-drivers-mcp-one-killprocessgroup-child-gr
…ines +57 (owner ruling: SKILL.md-path files) Entire-Checkpoint: 9b139eee7c8d
admarble
deleted the
feature/1472-refactor-drivers-mcp-one-killprocessgroup-child-gr
branch
October 19, 2026 22:05
This was referenced Oct 19, 2026
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
All five ACs for #1472 are met, and both derived ACs too. The branch
feature/1472-refactor-drivers-mcp-one-killprocessgroup-child-gris pushed with two commits (1cf65d2e6,f7bdcfa6d). I opened no PR because this run is orchestrated (SEQUANT_ORCHESTRATOR=sequant-run), so the orchestrator opens it from this summary.What changed:
src/lib/process-group.tsholds the onlykillProcessGroup(child, { graceMs }), which returns{ requested }.graceMsunless the child has closed. WithoutgraceMsthere is no escalation.DRIVER_SIGKILL_GRACE_MS = 5000, defined here once rather than imported from the MCP tool.RingBuffer: gains a{ maxLineChars }option andpushLines(text: string). Capped lines come out byte-identical to the old driver form.killRequestedand passes it to its evaluator. A SIGKILL close after the driver's own kill now reports asTimeout after Ns.src/mcp/tools/run.ts: the localkillProcessGroupandsendSignalare deleted. All four call sites pass{ graceMs: SIGKILL_GRACE_MS }; the constant and its fix(run): a watchdog-killed run writes no run log and half-deletes a clean worktree — worktree removal outruns the 5 s SIGKILL grace #1222 comment stay. The refactor(logs): one run-log module — parseLogFile, listLogFiles, resolveLogDir, formatDuration defined once #1471resolveLogDirimport and the fix(mcp): sequant_run reports another run's issues and verdict when its own run log is missing — a runId lookup miss falls back to the time window #1515 fallback are untouched.run.ts:process.kill(pid)instead ofproc.kill().[Unreleased]line.emptyCatchdropped from 119 to 118.proseGate.linesrose by 57 only because the new AC-2b block sits inopencode.test.ts, which already mentionsSKILL.md.npm run lint:healthnow prints "no metric rose".AC verification
rgcounts return1and1npx vitest run src/lib/process-group.integration.test.ts→ 8 passed: cases (a)–(d) on real detached children, plus no-grace, ESRCH, non-ESRCH fallback and no-pid-t "timeout"on the two driver test files → 10 passed (was 4). The new tests per driver: an evaluator case, a driver case where abort plus a SIGKILL close reads as a timeout, and a negative casergreturns3and1; the three suites pass with the existing kill assertions unchangednot_fired, exit 0killRequested(false or absent) still readsProcess killed by signal: SIGKILLin both driversring-buffer.test.tschecks a 2500-character line againstx×2000 + "… [2500 chars]"The /spec open questions are settled as recommended: SIGKILL escalation is on for the drivers, the grace is 5000 ms, and the constant lives in
process-group.ts. AC-2b's "≥ 4 passed" threshold in the issue text is still vacuous (4 pass on main), but the real count is now 10, so the owner may want to edit it to "≥ 6".Checks
npm run build✅,npm run lint✅,npm run lint:health✅.npx vitest run --changed origin/mainin three shards (103 files): 2297 passed, 1 failed. Listing those file paths alongside--changedrestricts the run to their overlap instead of adding to it, so the extra tests got a separate call.health-report.test.ts, and the MCP progress and run tests. (The runner restored this line after the exec body was cut off here; the full extra-test list is in the exec log.)src/lib/workflow/drivers/__tests__/driver-conformance.test.ts > commit: git add and git commit succeed inside the driver's default sandbox. Settled against base: it also fails onmainat ace33fc in this checkout (1 failed, 33 passed; macOS only). It is tracked by test(drivers): codex conformance commit item fails locally on macOS — git add exits 128 inside the sandbox #1480, and CI on Linux passes it.Mutation-verified: AC-2 — deleted the SIGKILL escalation call in process-group.ts; src/lib/process-group.integration.test.ts > 1472 process-group — killProcessGroup > 1472 AC-2 (a) escalates to SIGKILL after graceMs for a child that traps TERM failed; restored.
Mutation-verified: AC-2 — deleted the WeakSet early return in process-group.ts; src/lib/process-group.integration.test.ts > 1472 process-group — killProcessGroup > 1472 AC-2 (d) two calls on one child send one SIGTERM failed; restored.
Fixes #1472
Runner verification (2026-10-19)
After merging main (#1503, #1511, #1521, #1528), the runner re-ran AC-1..AC-4 at d9fad08:
1/13/1; the driver, run and ring-buffer tests: 208 passednot_firedThe runner reproduced both AC-2 mutations above. The AC-2b marker comes from exec and was not repeated.
Baseline:
emptyCatch.totaldrops from 119 to 118: −1 each in codex.ts and opencode.ts, +1 in the newprocess-group.ts.proseGate.linesrises by 57: the new timeout tests incodex.test.tsandopencode.test.ts, files the metric counts only because they mentionSKILL.md. The baseline absorbs it under the owner's 2026-10-19 ruling (investigation(test): classify the 76 prose-gate test files — execute, checksum or keep — with the command each execute-class gate should run #1511's finding). No issue redefines the metric yet: test(skills): convert execute-class prose gates to run the skill's command; delete checksum-class gates per the F-11 table and D-3 #1512 converts and deletes gates but keeps the count definition (its AC-1 caps the file count at keep + execute), so path-only files stay counted. (Corrected 2026-10-19: an earlier version of this text said test(skills): convert execute-class prose gates to run the skill's command; delete checksum-class gates per the F-11 table and D-3 #1512 fixes the metric.)Open, not blocking: AC-2 case (a) waits a fixed 150 ms for bash to install its trap. QA rated the flake risk on a loaded CI runner as low, and no failure has been observed.
🤖 Generated with Claude Code