Repository navigation
fix(sandbox): restore guest coding in private workspaces - #135702
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 8:53 PM ET / September 2, 2026, 00:53 UTC. ClawSweeper reviewWhat this changesThe PR makes isolated guest workspaces writable while keeping managed skills read-only, and propagates required sandboxing into child sessions. Merge readinessKeep open for normal maintainer handling: the recorded boundary acceptance addresses the prior review’s rank-up move, and the remaining merge gate is exact-head CI for this compatibility- and security-sensitive repair. Priority: P1 Review scores
Verification
How this fits togetherSandboxed agent tools use filesystem bridges to access private or shared workspaces, while session creation decides whether child runs must remain sandboxed. The changed policy permits writes in private storage but preserves protected instruction paths and host isolation. flowchart LR
A[Guest session] --> B[Sandbox policy]
B --> C[Private workspace]
B --> D[Child session creation]
C --> E[Filesystem bridges]
E --> F[Read-only skill mounts]
D --> G[Sandboxed child run]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -59, Tests +370, Docs +40. Total +351 across 35 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: 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: Land the canonical writable-private workspace behavior only after exact-head CI confirms the shared bridge, protected-skill, and child-inheritance coverage. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main marks the private workspace read-only unless access is rw, while the PR changes that predicate to reserve read-only behavior for ro only. Is this the best way to solve the issue? Yes. A shared read-only skill-mount projection is the narrowest repair because it keeps private workspace writes and immutable instruction roots consistent across local, remote, and OpenShell bridges. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 967a7ead7a20. 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)
|
|
Maintainer acceptance of the reviewed boundary: The data-model detector is flagging path-provenance code, not a schema change: the existing journal API and schema are unchanged. Classification now uses the filesystem backend's canonical namespace, and previously blocked private writes are attributed to the private workspace. Shared Rank-up move: boundary acceptance is recorded above; exact-head CI remains mandatory. The first CI run caught two sibling tests with obsolete |
|
Merged via squash.
|
…5702) * fix(sandbox): restore guest coding in private workspaces * test(sandbox): align private workspace sibling coverage
|
Thanks for finally getting this fixed |
…9876) Related: #136257 ## What Problem This Solves Fixes an issue where users leaving Automations open see old model suggestions after the Gateway publishes a changed catalog. Failed catalog reads also silently remove suggestions instead of showing the failure. ## Why This Change Was Made The Automations page now owns its typed catalog read and refreshes it on the existing configuration and chat-metadata notifications. Only the latest request for the current page and agent may publish results or errors. This removes the separate mutable suggestion helper and its duplicate parsing; the existing form-suggestion builder still owns normalization and sorting. Automatic reads retain `preparedOnly: true`. The change uses existing Gateway methods and does not alter provider discovery, authentication, configuration, session/default selection, or automation execution. ## User Impact New suggestions appear without reloading the page. Failed reads show an error while preserving the previous suggestions for the same agent and connection. Successful reads, including empty catalogs, replace them and clear the error. Draft fields remain unchanged. ## Evidence - Built-browser baseline at `2a488546aabe1921259e7d3a4f18be8f3741d77d`: initial model is visible; after `chat.metadata.changed`, the replacement option remains absent. The existing all-agents ownership scenario passes. - Built-browser candidate: both scenarios pass, covering both publication events, removal of old options, visible failure, retained options, empty recovery and draft preservation. This uses the real built Control UI with synthetic Gateway responses; it does not claim live provider acquisition. - Focused unit tests: 253 pass across the cron page, lifecycle, form-suggestion and cron library suites. Delayed successes and errors cannot publish after a newer request, agent switch, reconnect, Gateway replacement or page removal. Existing automation coalescing and mutation coverage remains intact. - Source-blind browser acceptance: all five contract clauses pass, including ten delayed-response orderings. All 33 catalog reads use prepared configured parameters; 244 captured requests contain no configuration, authentication, session-default or automation writes. The validator exercised the built UI independently and kept the same synthetic-provider limitation. - Real Gateway proof: coupled baseline and candidate UI/runtime builds run the normal Gateway. A supported CLI config change emits real `config.changed` and `chat.metadata.changed` notifications. The baseline keeps the old list; the candidate reads the published list and removes the retired option. A controlled transport fault replaces real catalog replies with `UNAVAILABLE` after recording them; the error appears, prior options remain, and another real publication restores reads without losing the draft. Catalog contents and notifications are never injected in this test. All five tests in the existing real-Gateway automation suite pass, including the new case. - Independent code review: no actionable findings through P2. Formatting, syntax-only lint, line/assertion ratchets and UI copy verification pass. Typechecking is left to CI. - Production: **−17 lines**. Tests/support: **+272 lines**. Docs: **+1 line**. Validation metadata: **0 net lines**, with the assertion allowance reduced from 13 to 11. The test growth adds built-browser refresh/recovery, real Gateway publication and five request-ownership cases; one obsolete helper test is removed. Focused commands: ```sh node scripts/run-vitest.mjs ui/src/pages/cron/cron-page.test.ts ui/src/pages/cron/cron-page.lifecycle.test.ts ui/src/pages/cron/form-suggestions.test.ts ui/src/lib/cron/index.test.ts node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/cron-agent-ownership.e2e.test.ts --maxWorkers=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/cron-duration-save.real-gateway.e2e.test.ts --maxWorkers=1 ``` Known unrelated baseline test: `src/agents/sandbox/browser.create.test.ts:606` assumes no protected skill mounts beneath its fixed temporary workspace. Independent controls on unmodified main `2a488546aabe1921259e7d3a4f18be8f3741d77d` pass with no skills directory and reproduce the same hash-label failure when only that directory exists. The production mount behavior from #135702 is intentional; the test fixture needs isolation. This PR changes no sandbox owner, dependency, runner or hash input. The exact completed CI result still determines whether the guarded unrelated-failure route is needed. Before: initial catalog choice; the baseline keeps this list after publication.  After: the published replacement appears and the draft remains.  Real Gateway flow: the controlled read failure is visible while the unsaved draft remains.  Co-authored-by: Ayaan Zaidi <[email protected]>
…nclaw#139876) Related: openclaw#136257 ## What Problem This Solves Fixes an issue where users leaving Automations open see old model suggestions after the Gateway publishes a changed catalog. Failed catalog reads also silently remove suggestions instead of showing the failure. ## Why This Change Was Made The Automations page now owns its typed catalog read and refreshes it on the existing configuration and chat-metadata notifications. Only the latest request for the current page and agent may publish results or errors. This removes the separate mutable suggestion helper and its duplicate parsing; the existing form-suggestion builder still owns normalization and sorting. Automatic reads retain `preparedOnly: true`. The change uses existing Gateway methods and does not alter provider discovery, authentication, configuration, session/default selection, or automation execution. ## User Impact New suggestions appear without reloading the page. Failed reads show an error while preserving the previous suggestions for the same agent and connection. Successful reads, including empty catalogs, replace them and clear the error. Draft fields remain unchanged. ## Evidence - Built-browser baseline at `b9a935ddeddc5e6545135912a69bee6f7051e90a`: initial model is visible; after `chat.metadata.changed`, the replacement option remains absent. The existing all-agents ownership scenario passes. - Built-browser candidate: both scenarios pass, covering both publication events, removal of old options, visible failure, retained options, empty recovery and draft preservation. This uses the real built Control UI with synthetic Gateway responses; it does not claim live provider acquisition. - Focused unit tests: 253 pass across the cron page, lifecycle, form-suggestion and cron library suites. Delayed successes and errors cannot publish after a newer request, agent switch, reconnect, Gateway replacement or page removal. Existing automation coalescing and mutation coverage remains intact. - Source-blind browser acceptance: all five contract clauses pass, including ten delayed-response orderings. All 33 catalog reads use prepared configured parameters; 244 captured requests contain no configuration, authentication, session-default or automation writes. The validator exercised the built UI independently and kept the same synthetic-provider limitation. - Real Gateway proof: coupled baseline and candidate UI/runtime builds run the normal Gateway. A supported CLI config change emits real `config.changed` and `chat.metadata.changed` notifications. The baseline keeps the old list; the candidate reads the published list and removes the retired option. A controlled transport fault replaces real catalog replies with `UNAVAILABLE` after recording them; the error appears, prior options remain, and another real publication restores reads without losing the draft. Catalog contents and notifications are never injected in this test. All five tests in the existing real-Gateway automation suite pass, including the new case. - Independent code review: no actionable findings through P2. Formatting, syntax-only lint, line/assertion ratchets and UI copy verification pass. Typechecking is left to CI. - Production: **−17 lines**. Tests/support: **+272 lines**. Docs: **+1 line**. Validation metadata: **0 net lines**, with the assertion allowance reduced from 13 to 11. The test growth adds built-browser refresh/recovery, real Gateway publication and five request-ownership cases; one obsolete helper test is removed. Focused commands: ```sh node scripts/run-vitest.mjs ui/src/pages/cron/cron-page.test.ts ui/src/pages/cron/cron-page.lifecycle.test.ts ui/src/pages/cron/form-suggestions.test.ts ui/src/lib/cron/index.test.ts node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/cron-agent-ownership.e2e.test.ts --maxWorkers=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/cron-duration-save.real-gateway.e2e.test.ts --maxWorkers=1 ``` Known unrelated baseline test: `src/agents/sandbox/browser.create.test.ts:606` assumes no protected skill mounts beneath its fixed temporary workspace. Independent controls on unmodified main `b9a935ddeddc5e6545135912a69bee6f7051e90a` pass with no skills directory and reproduce the same hash-label failure when only that directory exists. The production mount behavior from openclaw#135702 is intentional; the test fixture needs isolation. This PR changes no sandbox owner, dependency, runner or hash input. The exact completed CI result still determines whether the guarded unrelated-failure route is needed. Before: initial catalog choice; the baseline keeps this list after publication.  After: the published replacement appears and the draft remains.  Real Gateway flow: the controlled read failure is visible while the unsaved draft remains.  Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Closes #37634. A sandbox-required guest could chat but could not do ordinary coding work: the private
workspaceAccess: "none"workspace was mounted read-only, and both spawn paths rejected children before inheriting the parent's sandbox requirement. The real assembled file tools also treated container paths as host paths during memory-provenance classification.Why This Change Was Made
Keep isolation at its owning boundary without turning an isolated workspace into a read-only workspace.
nonenow provides writable private storage; explicitroand the shared-workspace boundary remain unchanged. One managed-skill mount projection protects instruction roots across local, remote, and OpenShell file bridges. Mount format v4 replaces stale container layouts.Child admission now derives immutable creator/sandbox policy from the authoritative parent under its lifecycle lock before checking execution policy. File-tool memory provenance reuses backend-owned canonical file identity, including remote aliases, and records private writes against the private workspace rather than the shared workspace.
The composed tests also exposed directory rename/remove rejection, untyped remote missing-file errors, inconsistent remote directory-alias preparation, and candidate-container environment influencing host plugin metadata discovery. These are repaired at their existing owners; missing files remain distinguishable from permission or transport failures, and canonical directory preparation retains no-follow file opens.
User Impact
Guests can write, edit, patch, run commands, and delegate inside their private sandbox without administrator access. Public cloning and dependency downloads still require the operator's existing network setting; this PR does not change the global no-network default or expose host credentials. Managed skill files remain read-only. Remote arbitrary shell execution still depends on the remote operator's filesystem policy, not file-bridge checks.
Thanks to @whyuds for the original workspace report. No new config option, schema version, protocol version, dependency, or changelog entry.
Evidence
ropassed its negative control. Connections had onlyoperator.readandoperator.write; role policy forced sandboxing with agent sandbox mode off.pnpm build:docker(all 11 invocations and post-build guards) passed.pnpm tsgo:coreand independent Codex review passed. The first CI run exposed two stale sibling-test expectations, a now-unused internal export, and a test-file line limit; the follow-up corrects these without changing runtime behavior. The cleanup has 110 passing focused tests (wrapper exit 0), passing targeted lint, formatting, and independent Codex review; final exact-head CI passed on3dd9470d47172eaa7e5f436f131241986f513f22, including both Windows test lanes and the required merge gate. All proof machines were released.The provider proof used patch
e3b026d22683c3d5817bbfc29f775b54080184cda001529a6081770a589345e9overa9469a2119a6cd4251c7346c896c8d9cae3633a3. The next change was a stable local observer binding in two call sites to satisfy TypeScript narrowing acrossawait; that candidate patchbf1fe8740a9bc49a493a638c0929117f7b038741b32bc99149f4128fe78e7f8bpassed the separately linked tests/build. The subsequent CI-only cleanup makes one unused helper private and updates/consolidates existing tests; it does not alter runtime behavior. Current head:3dd9470d47172eaa7e5f436f131241986f513f22.Named follow-up: sandboxed skill-path presentation. One Codex child attempted a shared-host skill pathname, received correct
/workspace/guidance from the sandbox boundary, and then completed successfully. Investigate the path's presentation/inheritance separately; do not broaden host filesystem access to compensate.