Skip to content

fix(mxc): Windows sandbox fails to activate or run commands - #158303

Merged
RomneyDa merged 6 commits into
openclaw:mainfrom
paulcam206:fix/mxc-isolation-session-readiness
Oct 2, 2026
Merged

RomneyDa merged 6 commits into
openclaw:mainfrom
paulcam206:fix/mxc-isolation-session-readiness

Conversation

@paulcam206

@paulcam206 paulcam206 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: the Windows MXC sandbox fails to activate on builds without the retired IsoEnvBroker service; even when activation succeeds, sandboxed commands fail because MXC 0.8.0 rejects the configuration sent to its executor.

User Impact

User impact: Windows users who opt into MXC can activate the sandbox and run agent tools without installing the retired service. A configured mxcBinaryPath must select an MXC 0.8.0-compatible executor that supports --probe; older overrides stop activation until updated, or unset so the bundled SDK executor is used after restarting the Gateway. The current plugin also requires an OpenClaw plugin API of 2026.9.6 or newer.

Why This Change Was Made

Readiness is checked against the same selected executor that runs commands. This avoids falling back to a different binary or a retired service-name check. When probing fails, the diagnostic preserves the host error and tells operators how to inspect the executor, update the override, or unset it and restart the Gateway.

The executor configuration uses MXC's accepted lifecycle.preservePolicy field, omits the removed processContainer.name field, and keeps containerId within the AppContainer name limit. The pinned SDK 0.8.0 still sends its base64 request envelope on process argv; this change does not address that transport limitation.

Evidence

  • Existing Windows behavior proof (head 77f05dc47d4774c6a83a0e230f5afd19e1015f7e): An isolated Windows x64 Gateway with IsolationSession present and IsoEnvBroker absent loaded MXC, completed a sandboxed exec turn, and denied access to a host-readable file. This exercised workspaceAccess: "none"; rw received executor dry-run validation only. The executor and Gateway were real; the model was mocked.
  • Existing MXC suite (head 77f05dc47d4774c6a83a0e230f5afd19e1015f7e): node scripts/run-vitest.mjs extensions/mxc passed 140/140 tests. The PR's Windows-only wire-contract test exercised the pinned executor's --probe and --dry-run.
  • Follow-up behavior proof: Before the final two executor-selection assertions were added, CI=1 node scripts/run-vitest.mjs extensions/mxc/test/plugin.test.ts extensions/mxc/test/readiness.test.ts extensions/mxc/test/binary-resolver.test.ts --maxWorkers=1 passed 31/31 tests. On the committed candidate 5e51ac3681e80c8b3ef07fdd807f324065c5a84f, after those assertions, CI=1 node scripts/run-vitest.mjs extensions/mxc/test/plugin.test.ts --maxWorkers=1 passed 10/10, including rejection before backend registration and recovery with the selected compatible override. That final plugin-test command took 110.27 seconds wall time, mostly cold worker transformation (92.86 seconds); the 10 tests themselves took less than one second. Windows CI seconds are not measured.
  • Follow-up checks: Direct extension production and test TypeScript checks, Oxlint on changed TypeScript files, Oxfmt check, conflict-marker check, and git diff --check passed. scripts/check-changed.mjs could not complete because the configured pnpm launcher points to a missing installation path; its other selected lanes did not run.
  • Review limitation: No fresh independent review verdict is available. AutoReview's Codex route failed authentication (403 followed by device-auth timeout); the permitted Claude fallback returned HTTP 400. The requested local ClawSweeper review could not run because the available dirty runner could not build with its missing pinned dependencies, and other permitted runner paths were absent. No code-review approval is claimed.

The source-checkout Gateway loaded bundled plugins from dist with OPENCLAW_DISABLE_BUNDLED_SOURCE_OVERLAYS=1; the real OpenClaw profile was unchanged. The least-privilege container denied the host-readable file and used the isolated sandbox workspace. The SDK executor and Gateway were real; the model turn was issued by a local mock model.

Current Windows builds replaced the IsoEnvBroker service with the demand-started IsolationSession service, so the readiness check failed with "IsoEnvBroker service is not installed" on hosts that can run MXC. Probe IsolationSession instead and make the test fake host name-aware so probing a retired name fails.
The plugin passes a raw ContainerConfig to spawnSandboxFromConfig, which forwards it unmapped to wxc-exec. wxc-exec 0.8.0 rejects filesystem.clearPolicyOnExit (an SDK-only alias) and processContainer.name (removed from the wire), so every MXC command failed with a configuration parse error after the 0.7.0 -> 0.8.0 bump.

Clear policy through lifecycle.preservePolicy, drop the removed name, and cap containerId at 64 characters because MXC now uses it as the AppContainer profile name. Add a Windows integration test that runs the pinned wxc-exec --dry-run against the generated config.
A Windows service name is the wrong readiness signal: IsoEnvBroker was renamed to IsolationSession, and MXC ProcessContainer depends on neither. Run wxc-exec --probe on the executor the backend launches and activate only when MXC selects an isolation tier, passing its error through and logging its degradation warnings.

The SDK contract test also checks readiness against the pinned probe and finalizes exec tokens so dry runs leave no sandbox temp directories.
@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 25, 2026
@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 1, 2026, 6:29 PM ET / 22:29 UTC (Revision 6).

ClawSweeper review

What this changes

The Windows MXC sandbox plugin probes its selected executor, sends compatible command configuration, and explains recovery for outdated executor overrides.

Merge readiness

⛔ Blocked before merge - 3 items remain

This PR remains necessary: current main and the latest release retain the reported defects. The follow-up addresses the earlier documentation and recovery-coverage request; maintainer acceptance of the stricter executor-override contract remains outstanding.

Priority: P1
Reviewed head: 5e51ac3681e80c8b3ef07fdd807f324065c5a84f
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused repair has meaningful Windows runtime evidence and no actionable correctness findings; the outstanding compatibility decision is separate from patch quality.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The captured body connects the MXC activation and configuration changes to a real Windows x64 Gateway and executor completing sandboxed exec while denying a host-file read. That execution path remains unchanged by the final diagnostics-and-tests follow-up. Override recovery uses mocked probe coverage, and rw has native dry-run coverage only; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured body connects the MXC activation and configuration changes to a real Windows x64 Gateway and executor completing sandboxed exec while denying a host-file read. That execution path remains unchanged by the final diagnostics-and-tests follow-up. Override recovery uses mocked probe coverage, and rw has native dry-run coverage only; no stored-data contract changes.
Evidence reviewed 9 items Current main still needs the fix: Current main checks the retired IsoEnvBroker service and still emits filesystem.clearPolicyOnExit and processContainer.name. The central activation and executor-configuration repairs are absent.
Latest release retains the activation defect: v2026.9.7 contains the same IsoEnvBroker activation check and pins MXC SDK 0.8.0.
Verified introduced production changes: The pinned introduction diff replaces the service check with a probe of the resolved executor, uses lifecycle.preservePolicy=false, removes the obsolete processContainer.name field, and limits per-command container IDs to 64 characters.
Findings None None.
Security None None.

How this fits together

MXC is OpenClaw's optional Windows sandbox plugin. It takes agent commands and filesystem policy, checks the selected executor's readiness, and launches isolated tool processes.

flowchart LR
 A[Agent sandbox settings] --> B[MXC plugin]
 B --> C[Selected executor probe]
 C --> D{Isolation available?}
 D -->|No| E[Actionable activation error]
 D -->|Yes| F[Command and sandbox policy]
 F --> G[MXC executor]
 G --> H[Isolated tool result]
Loading

Decision needed

Question Recommendation
Should existing mxcBinaryPath overrides be required to support the MXC 0.8.0 probe contract, with update-or-unset-and-restart recovery? Approve the documented executor requirement: Require the selected executor to support --probe and accept the documented recovery steps for incompatible overrides.

Why: The contributor has documented and tested the proposed boundary, but accepting activation failure for existing overrides requires maintainer intent.

Before merge

  • Resolve merge risk (P1) - Existing mxcBinaryPath overrides without --probe will stop activating after merge. Recovery is documented and covered with a mocked probe, but no maintainer has accepted this stricter compatibility boundary.
  • Complete next step (P2) - Obtain maintainer acceptance of requiring MXC 0.8.0-compatible --probe support for existing executor overrides.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Source +27, Tests +227, Docs +27. Total +281 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 4 71 44 +27
Tests 4 267 40 +227
Docs 1 32 5 +27
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 370 89 +281

Review metrics

Metric Value Why it matters
Executor compatibility 1 existing override gains a required probe contract; 0 new config options Operators with an incompatible configured executor must update or remove the override before activation succeeds.
Production versus test growth Production +29 net lines; tests +227 net lines Production growth implements probe validation and recovery diagnostics; test growth covers readiness, registration ordering, and the native wire contract.

Merge-risk options

Maintainer options:

  1. Accept the supported executor boundary (recommended)
    Approve requiring MXC 0.8.0-compatible probe support for overrides, with the existing diagnostic and recovery documentation.
  2. Define legacy compatibility first
    Keep existing overrides working by default through a verified compatibility path and expose stricter activation only through an approved opt-in.

Technical review

Best possible solution:

Use the selected executor as the readiness authority and retain compatible MXC command configuration, with an explicitly approved override upgrade contract.

Do we have a high-confidence way to reproduce the issue?

Yes, source establishes the failure path: current main rejects hosts without IsoEnvBroker and sends obsolete raw executor fields. This review did not execute Windows code; the contributor reports successful after-fix Gateway execution.

Is this the best way to solve the issue?

Yes, delegating readiness to the selected executor and correcting configuration at its producer is focused and maintainable. The remaining choice is whether to accept the documented compatibility boundary for older overrides.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2f4808320cf8.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P1: The current Windows MXC activation and command failures break an established opt-in agent tool workflow.
  • merge-risk: 🚨 compatibility: The introduced mandatory probe can stop existing configured executor overrides from activating.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured body connects the MXC activation and configuration changes to a real Windows x64 Gateway and executor completing sandboxed exec while denying a host-file read. That execution path remains unchanged by the final diagnostics-and-tests follow-up. Override recovery uses mocked probe coverage, and rw has native dry-run coverage only; no stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body connects the MXC activation and configuration changes to a real Windows x64 Gateway and executor completing sandboxed exec while denying a host-file read. That execution path remains unchanged by the final diagnostics-and-tests follow-up. Override recovery uses mocked probe coverage, and rw has native dry-run coverage only; no stored-data contract changes.

Evidence

What I checked:

  • Current main still needs the fix: Current main checks the retired IsoEnvBroker service and still emits filesystem.clearPolicyOnExit and processContainer.name. The central activation and executor-configuration repairs are absent. (extensions/mxc/src/readiness.ts:23, 2f4808320cf8)
  • Latest release retains the activation defect: v2026.9.7 contains the same IsoEnvBroker activation check and pins MXC SDK 0.8.0. (extensions/mxc/src/readiness.ts:23, c074824a27c9)
  • Verified introduced production changes: The pinned introduction diff replaces the service check with a probe of the resolved executor, uses lifecycle.preservePolicy=false, removes the obsolete processContainer.name field, and limits per-command container IDs to 64 characters. (extensions/mxc/src/mxc-container-config.ts:126, 5e51ac3681e8)
  • Dependency contract inspected directly: The target directly imports ContainerConfig and invokes spawnSandboxFromConfig from @microsoft/mxc-sdk, establishing the dependency signal. The published 0.8.0 archive was read in memory without executing it: dist/sandbox.js forwards raw configuration and maps clearPolicyOnExit to lifecycle.preservePolicy only in createConfigFromPolicy; its types deprecate processContainer.name in favor of containerId. Archive SHA-1: bc818a81e03e4ad767299f2f52ca4d3a36df7eae. Package README links and the GitHub repository endpoint verify microsoft/mxc ownership.
  • Windows production-path proof: The captured PR body, sourceRevision 107aa99153377759bb5d91854b1bd429d32abfd08b61ff8c279fdc60a99b7255, reports an isolated Windows x64 Gateway loading MXC without IsoEnvBroker, completing a sandboxed exec turn, and denying a host-readable file. The Gateway and executor were real; the model was mocked. workspaceAccess=none received runtime coverage; rw received native executor dry-run coverage. (77f05dc47d47)
  • Prior recovery request addressed: The latest commit adds explicit update-or-unset-and-restart guidance and a registration-boundary test covering rejection of an older override before backend registration, followed by recovery with the selected compatible override. The probe is mocked in this test. GitHub's exact commit patch confirms the follow-up changes diagnostics, documentation, and tests rather than the previously demonstrated execution configuration. (extensions/mxc/test/plugin.test.ts:193, 5e51ac3681e8)

Likely related people:

  • paulcam206: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-25T20:15:05.278Z sha 8dff63b :: needs changes before merge. :: none
  • reviewed 2026-09-25T20:30:37.754Z sha 8dff63b :: blocked before merge. :: none
  • reviewed 2026-09-25T22:54:47.405Z sha 8dff63b :: needs changes before merge. :: none
  • reviewed 2026-09-28T20:54:45.774Z sha 77f05dc :: blocked before merge. :: none
  • reviewed 2026-09-29T17:49:21.387Z sha 77f05dc :: blocked before merge. :: none

@paulcam206
paulcam206 marked this pull request as ready for review September 25, 2026 20:24
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 29, 2026
Require the selected MXC executor to satisfy the 0.8.0 probe contract and explain recovery for older overrides. Cover rejection before backend registration and recovery with a compatible executor.

Co-authored-by: Copilot <[email protected]>
@paulcam206

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 1, 2026
@RomneyDa
RomneyDa merged commit db24ac3 into openclaw:main Oct 2, 2026
105 of 108 checks passed
@paulcam206
paulcam206 deleted the fix/mxc-isolation-session-readiness branch October 2, 2026 22:56
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 3, 2026
…#158303)

* fix(mxc): probe IsolationSession service for Windows readiness

Current Windows builds replaced the IsoEnvBroker service with the demand-started IsolationSession service, so the readiness check failed with "IsoEnvBroker service is not installed" on hosts that can run MXC. Probe IsolationSession instead and make the test fake host name-aware so probing a retired name fails.

* fix(mxc): send wire-compatible container config to MXC SDK 0.8.0

The plugin passes a raw ContainerConfig to spawnSandboxFromConfig, which forwards it unmapped to wxc-exec. wxc-exec 0.8.0 rejects filesystem.clearPolicyOnExit (an SDK-only alias) and processContainer.name (removed from the wire), so every MXC command failed with a configuration parse error after the 0.7.0 -> 0.8.0 bump.

Clear policy through lifecycle.preservePolicy, drop the removed name, and cap containerId at 64 characters because MXC now uses it as the AppContainer profile name. Add a Windows integration test that runs the pinned wxc-exec --dry-run against the generated config.

* fix(mxc): gate Windows readiness on the MXC host probe

A Windows service name is the wrong readiness signal: IsoEnvBroker was renamed to IsolationSession, and MXC ProcessContainer depends on neither. Run wxc-exec --probe on the executor the backend launches and activate only when MXC selects an isolation tier, passing its error through and logging its degradation warnings.

The SDK contract test also checks readiness against the pinned probe and finalizes exec tokens so dry runs leave no sandbox temp directories.

* docs(mxc): clarify sandbox readiness comments

* fix(mxc): document executor override recovery

Require the selected MXC executor to satisfy the 0.8.0 probe contract and explain recovery for older overrides. Cover rejection before backend registration and recovery with a compatible executor.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
yozakura-ava pushed a commit to yozakura-ava/openclaw that referenced this pull request Oct 4, 2026
…#158303)

* fix(mxc): probe IsolationSession service for Windows readiness

Current Windows builds replaced the IsoEnvBroker service with the demand-started IsolationSession service, so the readiness check failed with "IsoEnvBroker service is not installed" on hosts that can run MXC. Probe IsolationSession instead and make the test fake host name-aware so probing a retired name fails.

* fix(mxc): send wire-compatible container config to MXC SDK 0.8.0

The plugin passes a raw ContainerConfig to spawnSandboxFromConfig, which forwards it unmapped to wxc-exec. wxc-exec 0.8.0 rejects filesystem.clearPolicyOnExit (an SDK-only alias) and processContainer.name (removed from the wire), so every MXC command failed with a configuration parse error after the 0.7.0 -> 0.8.0 bump.

Clear policy through lifecycle.preservePolicy, drop the removed name, and cap containerId at 64 characters because MXC now uses it as the AppContainer profile name. Add a Windows integration test that runs the pinned wxc-exec --dry-run against the generated config.

* fix(mxc): gate Windows readiness on the MXC host probe

A Windows service name is the wrong readiness signal: IsoEnvBroker was renamed to IsolationSession, and MXC ProcessContainer depends on neither. Run wxc-exec --probe on the executor the backend launches and activate only when MXC selects an isolation tier, passing its error through and logging its degradation warnings.

The SDK contract test also checks readiness against the pinned probe and finalizes exec tokens so dry runs leave no sandbox temp directories.

* docs(mxc): clarify sandbox readiness comments

* fix(mxc): document executor override recovery

Require the selected MXC executor to satisfy the 0.8.0 probe contract and explain recovery for older overrides. Cover rejection before backend registration and recovery with a compatible executor.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
(cherry picked from commit db24ac3)
Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. plugin: mxc proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants