Repository navigation
Conversation
|
🦞👀 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. What this changesThe PR adds per-agent network, timeout, and policy-file settings to MXC, OpenClaw’s Windows sandbox plugin, while retaining execution authority through command launch and filesystem mutation. Example: An operator configures different network policies for alpha and beta.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision Merge readiness⛔ Blocked before merge - 4 items remain Keep open: the new Windows final-effect evidence resolves the prior retirement-proof gap, but the policy semantics still require owner acceptance. Current main does not provide the requested per-agent MXC settings. Priority: P2 Decision needed
Before merge
FindingsNone. Provenance
Agent review detailsHow this fits togetherMXC runs agent commands inside Windows ProcessContainers and connects filesystem tools to permitted host workspaces. Core supplies the resolved agent identity; the plugin selects its policy and enforces it at execution and filesystem boundaries. flowchart TD
A[Agent turn] --> B[Core resolves agent and workspace]
B --> C[MXC validates live agent roster]
D[Plugin defaults and agent overrides] --> C
C --> E[Snapshot selected policy]
E --> F[Recheck execution authority]
F --> G[Windows command execution]
F --> H[Guarded host filesystem mutation]
Technical reviewBest possible solution: Keep policy selection plugin-owned, settle the operator-impact semantics with the sandbox/SDK owners, then integrate the prerequisite and validate the resulting current-main candidate. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction: current-main source confirms that MXC settings are plugin-wide, and the supplied Windows runs demonstrate the proposed capability. Is this the best way to solve the issue? Unclear until owner direction is recorded: plugin-owned policy selection with core-resolved identity is a focused design, but global stale-reference refusal and replacement-list semantics are product choices. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fbe2eca031b2. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +205, Tests +1459, Docs +199, Config 0, Other +3. Total +1866 across 34 files. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (5 earlier review cycles)
Reviewed October 8, 2026, 10:59 AM ET / 14:59 UTC (Revision 6). |
… creation Roster-only edits replaced every plugin: the loader keyed registrations on agent roster membership and the reload planner forced reloadPlugins for agents.entries changes, so MXC could re-run its registration-time roster check. Move the unknown-agent check to MXC backend creation. It reads the live roster through api.runtime.config.current() on every creation and still fails closed. Remove the core agentRosterKey and the agents.entries reload rule so roster edits keep their baseline reload scope.
Gateway restart and plugin disable retire the MXC registration. A hot reload that replaces the plugin serves new contexts from the new registration but does not revoke a turn admitted earlier; that turn keeps its generation, handles, and policy until it ends. The previous wording claimed replacement retired retained handles, which the host contract does not do.
The per-agent stack grew mxc-backend.test.ts past its line-cap ratchet (1467 counted lines at base). Move the factory and per-agent policy tests into mxc-backend-agent-policy.test.ts with shared fixtures in mxc-backend.test-support.ts. No test is dropped (56 before and after). New mocks pass the real module through. The new suite joins Windows CI part 2 and the PR-protected runtime inventory alongside its source file.
The agent-policy tests moved out of mxc-backend.test.ts, so divide its measured 8.1s by per-test body time instead of charging the new file the 3s fallback.
Resolve extensions/mxc/src/mxc-backend-factory.ts: keep the roster-aware factory options and signature; accept the removal of the factory doc comment from openclaw#166333.
…-launch boundaries
Related: #78096 (per-agent isolation and host-filesystem capability design; this is a narrower MXC-plugin proposal, not a fix for the entire issue).
Depends on #166632,
feat(sandbox): forward resolved agent ID to sandbox backends. These are dependent PRs againstmain, not a native GitHub stack. GitHub doesn't let a PR intoopenclaw/openclawuse a fork branch as its base, so both targetmain. This branch still carries the bottom changes in its own commits. After #166632 merges, they drop out of this diff.What Problem This Solves
Operators can't give different agents different MXC network modes, execution timeouts or filesystem policy-file selections. Today every agent shares one plugin-wide selection.
User Impact
Operators can set
plugins.entries.mxc.config.agents.<agentId>for separate MXC defaults. Omitted fields inherit plugin defaults. An explicitmxcPolicyPaths, including[], replaces the default list without removing built-in sandbox protections. Existing configuration stays valid. Draft for design and security review, not deployment or merge.Why This Change Was Made
Policy selection stays inside the MXC plugin. Core only forwards the trusted resolved agent ID (#166632). The plugin validates canonical agent IDs, snapshots each handle's selected policy, rejects overrides under effective shared scope, and keeps forced-private session/skill isolation. Helper shells stay network-blocked with native and outer timeout ceilings. Physical junction/symlink overlap checks reject static read/write aliases into read-only mounts and keep lexical mount identities.
Plugin defaults aren't common mandatory ceilings. Policy files augment filesystem access and cap timeouts, load per handle, and don't revoke in-flight commands when edited. Exec grants don't become filesystem-tool mounts. Per-tool/intent authorization and retargeting-race protection aren't part of this change.
Roster validation
Overrides are checked against the live roster (
api.runtime.config.current()) each time MXC creates a backend handle, not at registration. Roster edits don't reload plugins. While an override names an unconfigured agent (for example after a remove or rename), every MXC backend creation fails closed with:Invalid mxc plugin config: unknown agent ID "<id>"; configure the agent or remove plugins.entries.mxc.config.agents.<id>.A handle that already exists keeps its policy for the rest of its turn. Each creation reads one roster snapshot before any await, so a removal that lands mid-creation doesn't fail that creation; the next one fails closed.
openclaw sandbox explaindoesn't create MXC backends, so it doesn't report this error.The refusal is roster-wide on purpose. A stale override usually means an agent was renamed or removed. Failing only the unknown ID would let the renamed agent run silently on plugin defaults, which can be broader than the override it lost. Failing every creation makes the mistake visible on the next turn, and the error names the key to fix. This is a compatibility tradeoff that needs owner acceptance; a per-agent refusal is a small change if maintainers prefer it.
An earlier revision of this PR added a roster key to the core plugin load cache and identity, plus an
agents.entriesreload rule. A roster-only edit then replaced all 15 plugins, cron recovery failed and SIGUSR2 fired. That core change is removed (0acc46a), so roster edits are back to the baseline reload scope.Registration lifecycle
Gateway restart and plugin disable retire the registration: the factory creates no new backends, and its handles, exec specs and filesystem-bridge mutations reject new work. A hot reload that replaces the plugin serves new contexts from the new registration but doesn't revoke admitted work. A turn admitted before the reload keeps its generation, handles and policy until it ends. That matches core
publishPreparedPluginGeneration, where admitted leases keep their exact generation.Decision needed (open)
The policy semantics flagged by review (replacement lists, roster-wide stale-override refusal, admitted-turn snapshots, and the stricter junction admission) have no recorded sandbox/SDK owner acceptance yet. This PR doesn't claim it.
Evidence
Every result below comes from an alternative validation tree (frozen lockfile; @openclaw/codex and @openclaw/acpx excluded), because the configured feed doesn't yet serve the locked
@openai/[email protected]. These are filtered gates. They aren't a fullpnpm check, a full build or a hosted CI result. The previous hosted review applies to d33080a only, not to the commits below.Commits added since the last review head (d33080a)
main(961f5c0) into this branch. Resolves theextensions/mxc/src/mxc-backend-factory.tsconflict: keepsMxcSandboxBackendFactoryOptionsand accepts #166333's removal of the factory doc comment. No other conflictstest/contracts/mxc-sandbox-context.test.ts)Against current
main(da08dc8),git merge-treereports no conflicts. Since 961f5c0,mainchangedextensions/mxc/src/readiness.ts, its test and the MXC README. Those merge cleanly but aren't in the validated tree.Gates on 4731fbb
pnpm test <22 files> --maxWorkers=1: all ofextensions/mxc/test,test/contracts/mxc-sandbox-context.test.ts,src/plugin-sdk/fs-safe-compat.test.ts,src/agents/sandbox.resolveSandboxContext.test.ts,src/commands/sandbox-explain.test.ts,src/plugins/config-schema.test.ts,test/scripts/ci-windows-test-plan.test.ts,test/package-scripts.test.tspnpm tsgopnpm check:changedvs 961f5c0main961f5c0pnpm buildpnpm packmain's root npm package-lock guard, because the validation host's feed serves sha1-only package metadata. The runtime package below was produced from the same build with a proof-only, per-entry sha512-verified exception. It's a never-publish test artifact.Windows runtime: injected registration retirement in a live Gateway
Package: packed test-only artifact (never published), sha256
a2bb0ceb…2dea,build-info.commit4731fbb. It was installed on a Windows 11 guest (26700) with the supported updater from an earlier install, using the same filtered tree. Itsdist/extensions/mxccode is byte-identical to the build output; onlypackage.jsonopenclaw.build.bundledDistdiffers.Method: a Node inspector client attaches to the running Gateway and sets a non-pausing conditional breakpoint on the plugin's registration check (
assertRuntimeCurrent, theretiredflag that restart and disable cleanup set). An observe run records every check with its call stack. An inject run setsretired = trueat a chosen check index, which is the same state cleanup produces. Each lane uses a fresh Gateway, a realopenclaw agentturn and a scripted model. Every Gateway stopped gracefully.workspaceAccess: rw)assertBeforeMutation(native-pinned-write,native-pinned-write-windows,write-file-handle)bash-tools.exec-runtimeassertCurrent< supervisor childassertCurrent)MXC sandbox registration retired; resolve a new sandbox context.; target file absent on the hostThis is injected-fault proof through the production boundary. It isn't a natural restart or disable racing a live turn. A natural race isn't reproducible from outside: a hot replacement or disable waits for admitted work to drain, and a restart either lets the turn finish or cancels it at the drain deadline (covered by the host-kill row below). The same retirement checks are also covered by
test/contracts/mxc-sandbox-context.test.ts,plugin.test.ts,mxc-backend-agent-policy.test.tsandfs-bridge.test.ts.Windows runtime: per-agent policy rows
fs-safe0.24.2 confirmed; the external plugin keeps idmxc; after remediation the bundled source is usedPath escapes sandbox root), no host file; own-workspace write succeedsalpha(block),betaand hot-addedeta(allow)alphablocked;beta2/2 andeta6/6 reach the endpointghost, then removedetaagents.Analystconfig validaterejects italphaandbetaeach granted their own data dirWRITE_OK; other agent's dir and a plugin-wide-only dirWRITE_DENIED, no host file (no union)Package 920615aa (build-info 007221a918b) has the same source tree as this PR's commit 08f397e. Its rows weren't rerun on 4731fbb. Between the two, the branch adds d33080a (tests and CI planning only), the merge with
mainand the two commits above.Not claimed:
c2.retire.write. Its agent's exec wait step hits the documentedworkspaceAccess: rwnested-overlay refusal, so the bridge write runs before the patch. R3 replaces it.Disclosures, none fixed here:
workspaceAccess: "rw"with the sandbox skills mount under the workspace refuses exec-path writes ("overlaps read-only path"). This is the documented ProcessContainer limit. Bridge writes inrwmode work.Agent <id> startup preparation was supersededfailure sometimes drops a turn after a hot reload or after a hard process kill, before any MXC request. In one run it followed SQLite lock contention onplugins.lifecycle.lease.server-agent-database-startup.tsis unchanged by this PR.Not covered here
pnpm check, full build and a normalpnpm pack, after the@openai/[email protected]feed window and the feed's sha512 metadata are fixed.src/gateway/config-reload.test.tsfails 95 of 138 on this Windows host; the same 95 fail on the base.Earlier evidence
Gates on d33080a and the 285 focused cases on 21cd043 are superseded by the gates above for everything the new commits touch. The original exploratory fork draft (ChazGo#5 at
6634bef412e) is historical only.