fix(sandbox): keep none workspaces writable#37276
Conversation
Greptile SummaryThis PR fixes a bug where
Confidence Score: 5/5
Last reviewed commit: 9604e7d |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9604e7de08
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| return access === "rw" ? "" : ":ro"; | ||
| // `none` uses an isolated sandbox workspace at /workspace, so only `ro` | ||
| // should force the primary /workspace mount read-only. | ||
| return access === "ro" ? ":ro" : ""; |
There was a problem hiding this comment.
Bump sandbox hash for workspaceAccess=none mount change
Switching workspaceAccess: "none" from :ro to writable here only affects newly created containers, because existing sandbox/browser containers are reused when their openclaw.configHash still matches (the hash inputs in ensureSandboxContainer / ensureSandboxBrowser did not get a mount-semantics epoch bump). For users upgrading with already-created none containers, /workspace stays read-only until manual recreate/prune, so write/edit (and the newly enabled memory flush path) can still fail despite this fix.
Useful? React with 👍 / 👎.
edc0fd1 to
b4b443d
Compare
Made-with: Cursor
b4b443d to
285c2e3
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 285c2e3c01
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| return access === "rw" ? "" : ":ro"; | ||
| // `none` uses an isolated sandbox workspace at /workspace, so only `ro` | ||
| // should force the primary /workspace mount read-only. | ||
| return access === "ro" ? ":ro" : ""; |
There was a problem hiding this comment.
Bump config hash epoch for workspaceAccess=none behavior
Changing mainWorkspaceMountSuffix so workspaceAccess: "none" becomes writable changes runtime mount semantics, but existing containers are still reused because the hash inputs in computeSandboxConfigHash/computeSandboxBrowserConfigHash are unchanged and ensureSandboxContainer/ensureSandboxBrowser only recreate on openclaw.configHash mismatch. On upgrade, previously created none containers keep the old :ro mount until manual recreate/prune, so write/edit (and now memory flush) can still fail despite this fix. Fresh evidence: this commit updates docker.config-hash-recreate.test.ts expected mount behavior for none but does not change src/agents/sandbox/config-hash.ts or add an epoch bump.
Useful? React with 👍 / 👎.
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
Summary
workspaceAccess: "none"so sandbox sessions keep a writable isolated/workspaceinstead of inheriting read-only behavior fromrononemeans isolated-but-writable whileroremains the only read-only modeTest plan
pnpm test src/agents/sandbox/workspace-mounts.test.ts src/agents/sandbox/browser.create.test.ts src/agents/sandbox/fs-paths.test.ts src/agents/sandbox/fs-bridge.test.ts src/agents/pi-tools.create-openclaw-coding-tools.adds-claude-style-aliases-schemas-without-dropping-d.test.ts src/agents/sandbox/docker.config-hash-recreate.test.tspnpm exec vitest run --config vitest.e2e.config.ts src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts