Repository navigation
fix(sandbox): prepare protected skill mount sources on first launch - #182412
Conversation
Materialize the existing managed skill roots at workspace preparation before mount selection, retaining canonical containment, filesystem mutation guards, and current workspace custody. Continue the original first-launch repair from PR #96028 on the current sandbox lifecycle. Co-authored-by: momothemage <[email protected]>
|
🦞👀 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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
|
Codex review: needs real behavior proof before merge. What this changesThis PR creates missing managed skill directories before selecting read-only sandbox mounts. Example: A new writable sandbox starts with no host skills or .agents/skills directories.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 4 items remain Keep open: this maintainer-authored PR addresses the linked first-launch protection gap through the existing workspace and mount owners; no discrete introduced code defect was found. Priority: P1 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherSandbox preparation consumes the selected workspace, access mode, and lifecycle authority, then supplies protected filesystem sources to container and filesystem-bridge mount selection. flowchart LR
A[Selected workspace and authority] --> B[Workspace preparation]
B --> C[Guarded skill directory creation]
C --> D[Canonical mount selection]
D --> E[Container mount plan]
D --> F[Filesystem bridge policy]
E --> G[Protected skill paths]
F --> G
Technical reviewBest possible solution: Keep creation in workspace preparation, retain the shared validator and filesystem authority guard, and verify first-launch protection plus existing-container recovery. Do we have a high-confidence way to reproduce the issue? Current main omits absent skill directories from protected mounts, matching the linked Docker reproduction; this read-only review did not execute target code. Is this the best way to solve the issue? The patch is a focused repair using existing owners: preparation materializes shared candidates, while mount resolution remains validation-only and retains containment checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ab705c5790a6. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: No concrete introduced bypass was found, but final-effect authority evidence remains incomplete. EvidenceWhat I checked:
PR surfaceSource +71, Tests +64. Total +135 across 4 files. Added test files: 0. 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:
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 Reviewed October 24, 2026, 4:32 AM ET / 08:32 UTC. |
|
Merged via squash.
|
…penclaw#182412) Materialize the existing managed skill roots at workspace preparation before mount selection, retaining canonical containment, filesystem mutation guards, and current workspace custody. Continue the original first-launch repair from PR openclaw#96028 on the current sandbox lifecycle. Co-authored-by: momothemage <[email protected]>
What Problem This Solves
Fixes: a writable shared or private sandbox workspace can start without read-only protection on its managed skill directories when those directories do not exist yet on first sandbox launch.
User Impact
Sandboxed agents with writable workspaces now get the intended read-only skill overlays from the very first launch, not only after the skill directories happen to exist.
Why This Change Was Made
Mount selection filtered out managed skill directories that were absent at preparation time, so no read-only overlay was created for them. Workspace preparation now creates the missing managed skill roots before mount selection, sharing candidate selection with the existing validator, which still owns canonical containment and leaf-symlink rejection. Creation goes through the existing filesystem guard, which rejects symlinked mutation paths and rechecks lifecycle custody before each directory is made, and files or escaping symlink parents are left untouched; read-only workspaces are unchanged.
This continues closed PR #96028 by @momothemage, adapted to the current workspace lifecycle and mount owner, and keeps that original credit. Production LOC +79/-8; tests +64/-0; docs +0/-0. No config, protocol, SDK, dependency, or allowed-path policy change.
Evidence
src/agents/sandbox.resolveSandboxContext.test.tsfailed before the fix; both pass after it (2 passed).sandbox.resolveSandboxContext,sandbox/workspace-mounts, andsandbox/context.state-ownersuites passed 43 tests with 2 platform skips, covering real filesystem write rejection on selected read-only mounts, ordinary writable workspace behavior, symlink and non-directory parents, bind selection, and released state-owner custody.git diff --checkpassed.Fixes #94425