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: needs changes before merge. What this changesMoves generated Docker and Podman skills to a direct read-only mount while preserving retained-container and remote-plugin layouts. Example: A fresh writable Docker sandbox runs as UID 1000 and reads the demo skill.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 2 items remain Keep this PR open: it provides a proven repair for unreadable sandbox skills that current main still needs, with one prior diagnostic finding and a reported merge conflict remaining. Priority: P1 Before merge
Findings
Tests
Agent review detailsHow this fits togetherSandbox provisioning turns workspace and materialized-skill directories into container mounts; prompts, file tools, working-directory validation, and diagnostics must project those same mounts. flowchart TD
A[Sandbox configuration] --> B[Workspace and skill preparation]
B --> C[Container lifecycle]
C --> D[Actual skills mount layout]
D --> E[Prompt and file mapping]
E --> F[Agent skill reads]
Technical reviewBest possible solution: Retain the direct-mount repair and compatibility handling, and pass the resolved backend into sandbox explain's existing mount projection. Do we have a high-confidence way to reproduce the issue? The report, current-main mount topology, and supplied real Docker red/green traces establish the skill-read failure; this read-only review executed no target code. Is this the best way to solve the issue? Moving the generated mount fixes its topology at the provisioning owner without a privileged workspace ownership walk, while live-layout propagation preserves retained containers. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 137e7b2abc87. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +174, Tests +507, Docs 0, Other +1. Total +682 across 32 files. Added test files: 1. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
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 (48 earlier review cycles; latest 8 shown)
Reviewed October 18, 2026, 1:01 AM ET / 05:01 UTC (Revision 49). |
1aaa9bf to
f0e05b8
Compare
f0e05b8 to
48b8d05
Compare
|
@clawsweeper re-review CI is fully green on the latest head ( Real-behavior proof was strengthened in the PR body with three captured Docker runs:
Regression test now asserts the materialized skills mount destination AND its session-scoped ancestor are both provisioned and owned by the sandbox user. Local: 90 tests pass across the affected sandbox suites. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
48b8d05 to
47ac65b
Compare
47ac65b to
6298f1c
Compare
6298f1c to
85879e1
Compare
|
@clawsweeper re-review Revised head
Regression coverage: two CI on this head: |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Rebased head
Nonfatal and bounded to the Local verification (Node 26.7.0, satisfies the SQLite WAL gate):
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review CI is fully green on head This head keeps the two prior fixes and adds the deadcode compliance repair:
Local verification (Node 26.7.0): |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review CI fully green on head This head addresses the remaining P1 — Pin the full host-path walk to a no-follow descriptor — with a descriptor-rooted traversal for both creation and metadata:
Regression coverage already includes the symlinked intermediate-ancestor case ( Local verification (Node 26.7.0, Linux): |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review PR body updated on the current head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Head
CI green on |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Head
Regression: CI green on |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Exact-head CI is now fully green on |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Thanks @LiuwqGit! Proof: A real writable Docker sandbox ran as UID 1000. On current main, Docker created the nested generated-skills target as
Example
Validation
The old-head Rank-up move asked for the custom-workdir collision repair plus separate Docker, Podman, and browser creation tests. The dynamic target and real custom-workdir Docker proof are complete. I skipped separate Podman/browser creation tests because all three creation paths consume the same tested @openclaw/openclaw-secops, please review the sandbox security boundary before landing. |
|
@clawsweeper re-review Rebased onto latest main as head Backend-aware materialized skills layout. Main reworked the remote filesystem bridge to derive its protected skill roots from
Coverage added: a Local verification on the rebased head: the nine affected test files pass ( |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Follow-up for the three actionable findings and the merge-risk notes from the latest review (head [P1] Keep skill paths aligned with retained running containers — fixed. Real Docker transition evidence (retained pre-upgrade container with only the nested mount, fresh direct-mount container, both driven through the real CLI path): Covered by new regression tests in [P2] Document backend-specific generated-skill paths — fixed. The workspace-access skills note now states that Docker/Podman mount at [P3] Document the generated-skills bind reservation — fixed. The bind-security section now documents the Merge-risk notes: the obsolete mount-version claim was removed from the PR body (the base already uses version 4). The custom-binds-covering-reservation risk is now covered by the P3 documentation. Validation on the new head: |
|
Follow-up for the remaining P1 — Preserve the nested layout for existing SDK callers — pushed as head Omitted-backend default restored to nested. Old-shape remote read coverage. New regressions:
RED confirmed by reverting the resolver change on this head: both new regressions fail (2 failed / 33 passed). With the repair: all green. Validation on head |
Upgrading a recently used writable Docker or Podman sandbox retained the container with its old nested skills mount, while prompts and file mapping already advertised the new direct path. Shell commands and working directories referencing that path failed until the container was recreated. The container lifecycle now reports the skills mount layout the ensured container actually has, probing the mount list of a retained hot container, and prompt mapping, skill usage paths, and the filesystem bridge follow that layout until the container's normal safe recreation installs the new one. Freshly created containers always use the direct layout. The mount resolver also preserves the nested layout for the context shape shipped with plugin-sdk v2026.9.3 and earlier, whose SandboxFsBridgeContext carries neither backendId nor skillsMountLayout: an omitted backendId no longer selects the Docker direct mount, so unchanged remote SDK callers keep mapping local materialized skills to the nested remote destination they upload to. Docker and Podman consumers select the direct layout explicitly. Also documents the backend-specific generated-skills paths and the reserved bind destination, including relocation guidance for binds that an upgrade can invalidate. Refs openclaw#126631
|
Closing this PR: the root-owned mountpoint issue (#126631) was fixed on main via a different approach (#152641 and follow-ups #182412/#180840/#186247), which pre-creates the |
What Problem This Solves
Fresh writable Docker sandboxes can lose access to generated skills. Docker creates the missing nested target under
/workspaceasroot:root. A non-root sandbox user then cannot traverse/workspace/.openclaw, so skill reads fail withPermission denied.Upgrading an OpenClaw build on a machine with a recently used (hot) writable Docker or Podman sandbox must not break that running sandbox: the retained container still has the old nested skills mount, so advertising the new direct path would make every skill command and working-directory reference fail until the container is recreated.
Closes #126631.
Why This Change Was Made
The earlier patch tried to create and change ownership on the nested host path. That added a privileged filesystem walk inside an attacker-writable workspace. An opened directory can be renamed outside the workspace before a later descriptor-relative create or ownership change.
This repair removes that walk. Docker and Podman now mount the generated skill workspace at a direct child of the configured workdir. With the default workdir, the model-visible skill path is
/workspace/.openclaw-skills/skills/<name>/SKILL.md. Docker does not create the bind target in the writable host workspace. SSH keeps its existing remote workspace layout.The container lifecycle deliberately retains hot containers across config changes (
requireCurrentConfigstays unset for normal run setup). To keep prompts and file mapping aligned with such a retained container,ensureSandboxContainernow reports the skills mount layout the container actually has — probed from its live mount list — and prompt mapping, skill usage paths, and the filesystem bridge follow that layout until the container's normal safe recreation installs the new one. Freshly created containers always use the direct layout.Sandbox bind validation reserves the generated path. Direct, descendant, and covering custom binds are rejected by default. The existing explicit dangerous override remains available for trusted runtimes.
The generated-skills path is backend-specific: Docker and Podman use
<workdir>/.openclaw-skills/skills(derived from the configured workdir), while SSH and OpenShell keep the nested<workdir>/.openclaw/sandbox-skills/skillslayout. The sandboxing docs now state the distinction, identify/workspaceas the default workdir, and document the reserved bind destination including relocation guidance for binds that an upgrade can invalidate.The mount resolver preserves the nested layout for the context shape shipped with plugin-sdk v2026.9.3 and earlier:
SandboxFsBridgeContextcarried neitherbackendIdnorskillsMountLayout, and the resolver itself accepted neither field. An omittedbackendIdtherefore no longer selects the Docker direct mount — unchanged remote SDK callers keep mapping local materialized skills to the nested remote destination they upload to. Docker and Podman consumers select the direct layout explicitly via their backend id (or the probedskillsMountLayout), matching the prompt-side mapping that already required an explicit docker/podman backend for the direct layout.User Impact
.openclawmount target./workspace/.openclaw/sandbox-skills/skillsto/workspace/.openclaw-skills/skillsfor the default workdir.openclaw sandbox recreate), instead of advertising a path that only fresh containers have./workspace/skillsand/workspace/.agents/skills.Evidence
Real Docker red/green: On main
5d8ef653cd7198797983a957cd7b850f9880a8e9, a real writable Docker sandbox ran as UID 1000. Docker created.openclawasroot:rootmode0700, and the materialized skill read failed withPermission denied. On repaired head8b577f1a6ad91523c65a5377744a0fc563e24025, the same resolver and Docker flow read the unique skill marker from/workspace/.openclaw-skills/skills, while/workspaceremained writable and the old host target stayed absent. A second run with workdir/openclaw-skillsread the marker from/openclaw-skills/.openclaw-skills/skills.Race proof: During exact-head Docker provisioning, a worker replaced
.openclawwith a symlink to an outside directory 90,252 times. The outside directory listing, sentinel hash, mode, UID, and GID stayed unchanged. No outsidesandbox-skillspath was created. The sandbox still read its unique skill marker and wrote through/workspace.Upgrade transition (retained hot container) — real Docker:
/workspace/.openclaw/sandbox-skills/skills:ro, and a fresh direct-mount container with/workspace/.openclaw-skills:ro), driven through the realexecContainerCLI path, the newreadContainerSkillsMountLayoutprobe, andresolveSandboxSkillRuntimeInputsfrom this branch.docker inspect -f '{{range .Mounts}}{{println .Destination}}{{end}}'on the retained container (shows only the nested destination); probe the retained container's layout; probe the fresh container's layout; map skill paths with the pre-fix mapping (backend id only) and the fixed mapping (probed layout); verify each advertised path inside the real retained container withdocker exec test/cat.nestedand its advertised skill path exists and is readable inside it; the pre-fix mapping advertised a path that does not exist in that container; fresh containers keep advertising and reading the direct path.docker.skills-mount-layoutanddocker.config-hash-recreateunit tests against the mocked engine CLI); the/skillsprompt-inspection command path, which does not create a container and therefore always shows the current direct layout; and Podman on a real machine (Podman shares the same lifecycle and probe code path).Shipped-SDK compatibility (remote bridge, v2026.9.3 context shape):
createRemoteShellSandboxFsBridgeandresolveReadOnlyWorkspaceSkillMountsproduction modules driven with the exact shipped SDK context shape (SandboxFsBridgeContextwithoutbackendIdand withoutskillsMountLayout, as exported by plugin-sdk v2026.9.3), over a real on-disk workspace, materialized skills workspace, and remote workspace directory; the shell runner executes real scripts locally.<remote-workspace>/.openclaw/sandbox-skills/skills/...(the path the remote layout uploads to), and the Docker-only direct destination is selected only by an explicit docker/podman backend orskillsMountLayout: "direct". Before this repair, the omitted-backend shape selected the direct layout, so an unchanged remote plugin mapped its local materialized skill to<remote-workspace>/.openclaw-skills/skills/..., a path that never exists on the remote side — reads failed.Regression tests:
docker.skills-mount-layout.test.tscovers the retained-hot-container probe for both layouts plus fresh creation;docker.config-hash-recreate.test.tscovers hot-container retention without recreation;sandbox-skills.test.tscovers nested/direct prompt-path selection;workspace-mounts.test.tscovers the nested mapping for retained Docker containers, the nested default for the shipped SDK context shape, and the explicit docker/podman direct selection;workspace-skills-bridge-readonly.test.tscovers the old-shaped remote bridge mapping (local materialized skill → nested remote destination) and keeps remote protection covered.Validation:
pnpm install --frozen-lockfileand fullpnpm buildpassed.pnpm docs:listandpnpm docs:check-mdxpassed; the MDX check covered 791 files.oxfmtandgit diff --check.tsgo:coreclean; focused Vitest runs green across the affected sandbox, embedded-agent, agents-tools, auto-reply, and CLI shards (330+ tests), including the rebase-conflict resolution incommands-system-prompt.test.ts; changed files passoxfmt/oxlint.validate.shfully green (oxfmt, oxlint, same-directory Vitest,tsgo:core); focused Vitest runs green across the affected sandbox, embedded-agent, agents-tools, auto-reply, and CLI shards (640+ tests, 5 shards), including the new shipped-SDK-shape regressions. Before the repair, both new regressions fail on the pre-fix condition (RED confirmed by reverting the resolver change: 2 failed / 33 passed).Line count: production +43/-19, tests and test support +120/-106, docs +1/-1 for the original repair. The follow-up adds the layout probe (+41 source lines including the new
skills-mount-layout.tsprobe module), layout-aware prompt/file mapping, and the two documentation corrections.