Repository navigation
fix(qa): cancellation is ignored during command cleanup - #133143
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 3:48 AM ET / 07:48 UTC. ClawSweeper reviewWhat this changesThe PR makes POSIX QA command cleanup preserve a parent SIGINT or SIGTERM received after command exit or timeout, then re-raise it after cleanup while keeping the recorded command result. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessThe patch is correct: it retains cancellation independently of the already-frozen command result and re-raises it after owned cleanup. Keep this maintainer-authored, protected PR open for normal maintainer landing review and completion of the exact-head checks still running in the captured context. Priority: P2 Review scores
Verification
How this fits togetherQA Lab starts native scenario commands and owns their process-group cleanup. The settlement layer records a terminal command result, drains inherited stdio, cleans descendants, then returns the result or re-raises a parent interruption. flowchart LR
A[QA scenario command] --> B[POSIX settlement]
B --> C[Freeze command outcome]
C --> D[Drain stdio and clean process group]
D --> E[Re-raise parent signal]
E --> F[QA controller stops]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -4, Tests +23. Total +19 across 2 files. View PR surface stats
Review metrics
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: Retain the shared settlement-owner repair and its three-state regression coverage, then land once normal maintainer review and exact-head checks are complete. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the failure: current main freezes an exit or timeout primary and later derives cancellation only from that primary. The linked report also supplies a concrete native-process ordering, though this read-only review did not execute target code. Is this the best way to solve the issue? Yes. Storing cancellation in the shared settlement owner repairs all opted-in parent-signal flows without replacing the result that downstream callers consume; consumer-side handling would split that lifecycle invariant. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c04bee452e70. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
532981e to
fba60c7
Compare
|
Merged via squash.
|
Closes #133142
What Problem This Solves
Fixes an issue where QA operators canceling a native test command could see the command continue successfully when its leader had already exited but descendant cleanup was still pending. SIGINT and SIGTERM were also lost after a timeout entered cleanup.
Why This Change Was Made
Record parent cancellation independently from the first command outcome in the shared POSIX settlement owner, then re-raise it after cleanup. Remove redundant timer forwarding and cancellation wrappers in that same owner. The leader exit code, timeout/error result, cleanup escalation, and Windows behavior remain unchanged. Replacing the frozen command outcome would lose the result consumed by the native, QA CLI, and Matrix CLI callers.
User Impact
QA cancellation remains effective throughout command cleanup. This is internal QA tooling; no production gateway behavior, configuration, provider, plugin API, or persistent state changes.
Evidence
check:changedpassed on the final source, including extension/test typechecks, lint, owner guards, and import-cycle checks. Formatting andgit diff --checkpassed.Focused command:
CI note: the first exact-head run (33298447673) failed because the current main merge tree imported
getPluginToolSideEffectOwnerKeyfrom its former module. The canonical main repair #133155 fixes that import. This branch is refreshed onto that repaired base atfba60c7a091ee637f10e1ea62ceabe0075a787be; the complete patch identity and source/test bytes are unchanged. All 44 focused tests and the real native SIGINT/SIGTERM before/after proof passed again, fresh structured autoreview is clean, and the independent verifier bound its verdict to this exact head. The final separate read-only review also found no actionable findings. Fresh exact-head CI 33299847607 passed. Native preparation and merge gates passed without changing the reviewed head. Merged as bed5daf176f6d7552b27b7c87d33e7d201dd82f6, verified on canonical main; the linked issue is closed.