Repository navigation
fix(mxc): tasklist no longer hangs past sandbox timeout - #1151
Conversation
Co-authored-by: Copilot App <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 4:08 PM ET / 20:08 UTC. ClawSweeper reviewWhat this changesThe PR bounds MXC cancellation cleanup after a sandboxed Windows command times out, while preserving complete redirected output for normally exited commands. Merge readinessKeep open. The repaired head addresses both prior findings, and the collaborator-authored PR has current-head validation claims plus an active linked bug; it needs normal maintainer merge review rather than automated cleanup. Priority: P1 Review scores
Verification
How this fits togetherThe Windows node runs approved commands through the MXC AppContainer launcher and returns their output to the gateway. This change affects timeout recovery before the node reports the invocation result. flowchart LR
A[Gateway command request] --> B[Windows node]
B --> C[MXC sandbox launcher]
C --> D[Command process]
D --> E{Completes or times out}
E -->|Completes| F[Drain output and return result]
E -->|Times out| G[Terminate process tree]
G --> H[Bounded cleanup and timed-out result]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep bounded cleanup only on cancellation, retain lossless normal-exit draining, and land after maintainers accept the bounded-recovery tradeoff and required checks pass. Do we have a high-confidence way to reproduce the issue? Yes. The linked report gives a concrete sandboxed Is this the best way to solve the issue? Yes. Restricting the cleanup cap to cancellation directly fixes the hang while preserving the established lossless drain on normal exits and leaving MXC policy unchanged. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 17a8b0363a82. 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 (4 earlier review cycles)
|
|
Retried the failed Build and Test job twice today.
All MXC E2E shards and the other test stages passed when reached, but the PR's own cleanup-bound regression test is not stable under CI load. I did not merge while the required |
|
Follow-up diagnosis: this is primarily a timing-test issue, not evidence that the cleanup architecture is broken. Why:
Architectural tradeoff that still needs maintainer acceptance: after the 500 ms production cleanup cap, a launcher that ignored process-tree termination may survive, and late output may be discarded. That is intentional availability-over-perfect-cleanup behavior and matches the existing bounded-drain pattern. Recommended branch fix:
|
Keep lossless output draining on normal completion while bounding only the cancellation path. Synchronize cancellation after launcher startup and assert the semantic cleanup contract with a scheduler-tolerant ceiling. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 27dc9d2f-ee94-48f1-bf06-8f3d10414fc9
|
Pushed a deterministic repair at Changes:
Validation:
|
Closes #1149
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
Fixes an issue where users running
tasklistor another non-terminating command in the Windows node MXC sandbox could see the node invocation remain pending after the configured timeout.Why This Change Was Made
MXC cancellation now retains process-tree termination but replaces unbounded launcher and redirected-pipe cleanup with process-exit and pipe-completion signals capped at 500 ms. A deterministic test seam covers the case where the launcher survives the kill attempt without changing sandbox capabilities or process-enumeration policy.
User Impact
Sandboxed Windows node commands now return a timed-out result promptly instead of remaining stuck indefinitely after their timeout expires.
Evidence
MxcExecutor.RunAsyncreturns a timed-out result within one second.Change Type
Scope
winnodeValidation
./build.ps1: passed, all five projects built successfully.dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: passed, 3,641 passed and 32 skipped.dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: passed, 2,249 passed.dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore --filter "FullyQualifiedName~MxcExecutorTests": passed, 3 passed../scripts/validate-mxc-e2e.ps1: passed, 17 passed, including all three required gateway MXC proofs.Real Behavior Proof
c31f320aMxcExecutorTests, full required build and test suites, then./scripts/validate-mxc-e2e.ps1.Yes/No/N/A): N/Atasklisthost-process enumeration was not asserted because visibility remains governed by AppContainer policy. Iftasklistcannot complete, the invocation now returns after the configured timeout instead of hanging indefinitely.Security Impact
Yes/No): NoYes/No): NoYes/No): NoYes/No): YesYes/No): NoYes, explain the risk and mitigation: Only host-side cancellation cleanup changes. Existing MXC policy, process-tree termination, capability checks, and timeout reporting remain in place; the cleanup wait is now bounded.Compatibility and Migration
Yes/No): YesYes/No): NoYes/No): NoReview Conversations