Repository navigation
fix(mxc): bound termination and output drain cleanup - #1387
Conversation
Preserve final redirected output fragments while bounding cancellation and inherited-pipe cleanup. Cap blocked process-tree kill workers and coordinate process ownership until cleanup completes. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1c0274bb-f65e-4900-be1b-1303a10fdec5
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 11, 2026, 3:14 PM ET / 19:14 UTC (Revision 17). ClawSweeper reviewWhat this changesBounds Windows sandbox process termination and output draining while preserving final output fragments, with regression tests for blocked termination and inherited pipe handles. Merge readiness⛔ Blocked before merge - 2 items remain This PR remains useful because current main still has both unbounded paths. No definite introduced defect was found, but the required integrated MXC proof remains blocked and the recorded human-review hold still applies. Priority: P2 Review scores
Verification
How this fits togetherThe Windows node passes sandboxed command requests and cancellation signals to the MXC executor, which launches wxc-exec. Its process cleanup and output capture determine when command results return to the caller. flowchart TD
A[Sandboxed command request] --> B[Windows sandbox executor]
B --> C[MXC launcher]
C --> D{Exit or cancellation}
D --> E[Bounded termination and pipe drain]
E --> F[Captured output and command result]
F --> G[Windows node caller]
Before merge
Agent review detailsSecurityNone. 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 bounded cleanup and final-output preservation, backed by passing current-head Windows Gateway-to-node MXC proof before landing. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the blocking paths: a synchronous tree kill can stall cancellation, and inherited pipe handles can prevent the normal drain from completing. This review did not execute a reproduction. Is this the best way to solve the issue? Yes, the patch addresses the remaining waits within the existing executor and protects output handling with focused process fixtures; integrated validation is still required. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 734763131c8d. LabelsLabel 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 (16 earlier review cycles; latest 8 shown)
|
Use a silent inherited-handle child so exact pipe-buffer output assertions cannot be polluted by scheduler-dependent descendant writes. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1c0274bb-f65e-4900-be1b-1303a10fdec5
|
@clawsweeper re-review |
|
🦞👀 I queued a lightweight read-only assist pass. It will post a separate answer comment and will not edit the durable ClawSweeper review comment or trigger close, merge, repair, label, or branch changes. Request: re-review |
|
ClawSweeper assist: Evidence:
Suggested next action: Request Source: #1387 (comment) |
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
@clawsweeper stop This PR is intentionally frozen until a capable |
|
🦞✅ I added |
Supersedes #1166 (fix(mxc): bound termination and output drain cleanup) with a current-main replacement based on
4064eb9c. Current head:fc54e2ee.This keeps MXC cleanup bounded without reusing SetupEngine ownership blindly. It caps blocked process-tree termination workers, preserves the original handle-backed
Processuntil a kill worker releases it, bounds post-exit pipe drain, and captures raw redirected bytes so newline-free, exact-buffer, configured-encoding, and fragmented-BOM final output is retained. Dedicated reader threads use bounded repeatedCancelSynchronousIocancellation for the synchronous anonymous pipes created bySystem.Diagnostics.Process, closing the inherited-handle race without allowing the invocation to hang.The exact-buffer regression uses a silent inherited-handle child, so the expected 4,096-byte parent output cannot be polluted by scheduler-dependent descendant writes.
Required proof pools
windows-wsl-mxcValidation
Current head
fc54e2ee:./build.ps1: passeddotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: 3,998 passed, 32 skipped, 0 faileddotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: 2,865 passed, 0 skipped, 0 faileddotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore --filter 'FullyQualifiedName~Mxc': 225 passed, 7 environment-gated skips, 0 faileddotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore --filter 'FullyQualifiedName~MxcExecutorTests': 10 passed, 0 failedfc54e2ee: clean, no accepted/actionable findingsfc54e2ee: clean, no actionable findingsReal behavior proof
Not verified / blocked. Do not merge.
./scripts/validate-mxc-e2e.ps1was run without-AllowSkip. Repository build succeeds, but fresh Ubuntu 24.04 WSL setup fails before any Gateway-to-Windows-node MXC behavior executes:No Crabbox validation was used. This PR must remain draft and blocked until the non-skipping
windows-wsl-mxcproof passes on a capable host.