Repository navigation
fix(qa): settle Unix commands after PGID cleanup - #120010
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 7, 2026, 5:39 AM ET / 09:39 UTC. ClawSweeper reviewWhat this changesThe PR centralizes Unix QA child-process settlement so test-file, suite, and Matrix commands bound inherited-stream draining and clean their original process group before returning results. Regression provenancePossible regression — probable (failure trace; reviewed change). No predecessor PR is attributed. Merge readinessKeep open. The PR is not on current main or the latest release, both prior P2 findings are fixed, and no new actionable patch defect was found; its maintainer label and intentional process-group ownership boundary require QA-owner handling before merge. Priority: P2 Review scores
Verification
How this fits togetherQA Lab runs child commands for scenarios and suites, then reports their terminal outcomes to schedulers and CI. This settlement layer consumes process/stream events and emits a bounded result after cleanup. flowchart LR
A[QA command] --> B[Child process events]
B --> C[Shared settlement owner]
C --> D[Bounded stream drain]
D --> E[Original process group cleanup]
E --> F[Scenario or suite result]
F --> G[QA scheduler and CI]
Decision needed
Why: The code intentionally declines unsafe positive-PID fallback signaling; choosing that process-ownership boundary is an operational QA policy decision, not a mechanical review finding. Before merge
Agent review detailsSecurityNone. PR surfaceSource +133, Tests +579. Total +712 across 11 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the shared settlement owner and safe negative-PGID boundary, then refresh the exact current-main merge result and focused QA lifecycle proof before merging. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source exposes close-only settlement, and the PR’s focused Linux scenario covers a leader exit while a descendant retains inherited stdio. Is this the best way to solve the issue? Yes. One shared owner removes three duplicated lifecycle implementations while preserving caller-specific Windows behavior and the established zombie-aware liveness policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2dd0e9b95046. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
a4ce933 to
9cbbb2c
Compare
9cbbb2c to
e4cda65
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Punchcard-Session: cobalt-valley-meadow-mg
e4cda65 to
83a0756
Compare
Punchcard-Session: cobalt-valley-meadow-mg
Related: #119396
Problem and root cause
The maturity run on
mainwrote the Docker scheduler result, but the QA parent did not settle before the workflow supervisor terminated it at 04:29:37 with exit 124 (run 31141527327). The 04:11:40 summary-write timestamp comes from the captured reproduction evidence; the job log independently confirms the later supervisor timeout.The architectural owner was the QA command lifecycle. It listened only for Node's
closeevent, while Node explicitly permitsexitbefore inherited stdio closes and emitscloseonly after the process ends and all stdio closes. A descendant retaining inherited pipes therefore preventedclose, so original-PGID cleanup never began. The Docker batch intentionally has no per-command timeout because its scheduler/workflow owns the aggregate deadline, making this an unbounded parent wait.Dependency contract: Node
exit, Nodeclose, and detached process groups.Canonical fix
QA Lab now has one settlement owner shared by test-file scenarios, suite CLI execution, and Matrix scenario CLI execution:
exit, timeout, manual cleanup, parent signal, spawn error, or stream error;/procinspection treating zombie/dead-only groups as stopped;This also implements both ClawSweeper review cycles: a nonzero suite CLI exit is no longer discarded when cleanup fails, and a post-exit stream failure is retained by the shared outcome and rejected by Matrix. Focused regressions cover both event orderings.
CI failure classification
The previous
check-lintfailure was PR-caused: fivetypescript(unbound-method)findings inposix-command-settlement.test.ts. The tests now retain and assert bound spies.openclaw/ci-gatewas only the derived failure. Previous production and test typechecks passed; the related maturity timeout was onmain, not PR CI.Proof
83a0756121d75a0b5c6120f6701e17461c59091f74500f334ed147bd9ac23abb7e3b0cd36f49d124tbx_01kzdmjzq74m9bxbvftxmpe0f7: formatting, production/test types, full 245-rule changed-file lint (0 warnings/errors), dependency/boundary/dead-code/import-cycle guards all passed.tbx_01kzdn32gw5kym7gjepnsx220e: 53/53 focused tests passed. The maturity-signature case settled in 639 ms after the leader wroteDocker scheduling finishedwhile a live descendant retained inherited stdio.tbx_01kzdp8c8eqzze32h1yvc67gsg: 57/57 tests passed. The maturity-signature case settled in 675 ms, and Matrix rejected the exactexit(0)then stdout-error-before-closeordering. The one-shot lease stopped successfully.check-lint, production/test types, build, QA smoke, all Node shards, andopenclaw/ci-gate.exit(0)followed by a stdout error beforeclose; full type-aware changed-file lint, formatting, andgit diff --checkpassed locally.LOC and simplification
+618/-485, net+133.+588/-9, net+579.The positive production delta is the canonical lifecycle/liveness boundary used by three callers. The change deletes caller-specific cleanup policy, removes the write-only
cleanupFailureresult field, and keeps the suite caller below its max-lines limit. Further reduction would duplicate or weaken timeout, signal, inherited-stdio, and zombie semantics.Remaining risks
A descendant that deliberately starts a new session/process group is outside the original PGID by design. This owner bounds and reports that case but does not use unsafe positive-PID fallback signaling; the scheduler that creates detached lane PGIDs remains responsible for those groups. Windows keeps its existing task-tree behavior through the shared settlement adapter.
Rerun instructions
Do not increase the maturity workflow timeout; rerun PR CI and then the maturity profile on the merged candidate SHA.