fix(mxc): bound termination and output drain cleanup - #1166
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed August 16, 2026, 10:23 AM ET / 14:23 UTC. ClawSweeper reviewWhat this changesThe PR bounds MXC process-tree termination and redirected-output cleanup, caps stuck kill workers at eight, and adds Windows regression coverage for those cases. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readiness⛔ Blocked until stronger real behavior proof is added - 5 items remain The branch addresses a current MXC cleanup availability gap with focused native-process coverage, but it needs the repository-required Gateway-to-Windows-node MXC proof before merge. Priority: P1 Review scores
Verification
How this fits togetherMXC executes approved Windows commands inside the node path. Its cleanup runs after cancellation or launcher exit and must return a command result without blocked descendants or inherited output handles exhausting invocation capacity. flowchart LR
A[Approved system.run request] --> B[MXC launcher]
B --> C{Cancelled or launcher exited}
C --> D[Bounded kill worker]
D --> E[Bounded output drain]
E --> F[Result to gateway]
D --> G[Eight shared worker slots]
G --> D
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve the bounded cleanup design and attach redacted current-head Do we have a high-confidence way to reproduce the issue? Yes, at source level: the branch adds deterministic Windows regressions for blocking termination, worker saturation, and inherited output handles. The required gateway-mediated MXC reproduction remains unverified. Is this the best way to solve the issue? Yes for the code path reviewed: a process-wide bounded worker pool plus bounded drain directly addresses the synchronous kill and inherited-handle waits without changing command authority or policy. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fc9add75eda7. 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 (1 earlier review cycle)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Summary
This addresses NODE-2 in issue #1122. It intentionally does not close #1122 because that issue contains multiple findings.
Root cause
Cancellation could block synchronously in process-tree termination. The normal launcher-exit path could also wait indefinitely when a descendant retained inherited stdout or stderr handles. The first bounded-kill implementation could retain one dedicated worker per permanently blocked kill.
Change
Regression coverage
Validation
Current head:
bb12539epowershell.exe -NoProfile -ExecutionPolicy Bypass -File .\build.ps1: passed. Shared, CLI, WinNode CLI, SetupEngine, and WinUI built successfully; documentation validation passed for 46 Markdown files.dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore --filter FullyQualifiedName~Mxc: 200 passed, 7 environment-gated skips, 0 failed.dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore: 3,698 passed, 32 skipped, 4 failed. The four failures are unchangedExecReusableCommandBinderTestsfailures and all four reproduced on pristine basefc9add75in a detached temporary worktree.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore: 2,469 passed, 0 skipped, 0 failed.python .\.agents\skills\autoreview\scripts\autoreview --mode local ...: clean, with no accepted or actionable findings after the concurrency and test-determinism fixes.The four base-reproduced Shared failures are:
CarrierPayloadWithExplicitRelativePath_IsNotTreatedAsAmbiguousAcceptedSpaceGrammar_MatchesRealCmdChildArgvAcceptedMultiElementTail_MatchesRealCmdChildArgvAcceptedTabGrammar_MatchesRealCmdChildArgvReal behavior proof
Current-head local Windows process regressions passed:
The descendant-retained-handle test launches a real Windows child process that inherits stdout and stderr handles after its parent exits. The parent result returned successfully inside the bound, and the test cleaned up the descendant.
Proof limitation
Gateway MXC E2E was not run because this task explicitly prohibited Gateway MXC E2E. It is not presented as passed. No Gateway, pairing, permission, credential, or Pavilion install path was used.
Security and capability impact
No new permissions, identity, pairing, network, sandbox, or command authority.