fix(sandbox): allow mkdirp on existing workspace directories#30521
Closed
liuxiaopai-ai wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix(sandbox): allow mkdirp on existing workspace directories#30521liuxiaopai-ai wants to merge 1 commit intoopenclaw:mainfrom
liuxiaopai-ai wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Contributor
Greptile SummaryFixed a sandbox filesystem bug where
Confidence Score: 5/5
Last reviewed commit: 67af7ea |
Contributor
|
Thanks for the PR! Multiple PRs address the same fix. Keeping #28853 as the earliest submission. Closing to reduce noise. This is an AI-assisted triage review. If we got this wrong, feel free to reopen — happy to revisit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Describe the problem and fix in 2–5 bullets:
mkdirpsafety checks used file-open validation, which treats an already-existing directory target as a validation failure.write/editflows callmkdiron parent paths first, so valid/workspace/...writes could fail withSandbox boundary checks failedeven withworkspaceAccess: rw.mkdirpnow allows the specific existing-directory validation case, while still running canonical mount and writability checks; added regression coverage for existing/workspacedirectory targets.mkdirpsafety policy.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
write/editflows no longer fail when creating or reusing existing parent directories under/workspacewithworkspaceAccess: rw.Security Impact (required)
No)No)No)No)No)Yes, explain risk + mitigation:Repro + Verification
Environment
agents.defaults.sandbox.workspaceAccess: rwSteps
workspaceAccess: rw./workspace/...where parent directories may already exist.mkdirpsafety validation behavior.Expected
Actual
Sandbox boundary checks failed; cannot create directories: ....Evidence
Attach at least one:
Passing after patch:
pnpm vitest src/agents/sandbox/fs-bridge.test.tspnpm vitest src/agents/pi-tools.workspace-paths.test.tspnpm oxfmt --check src/agents/sandbox/fs-bridge.ts src/agents/sandbox/fs-bridge.test.tspnpm oxlint --type-aware src/agents/sandbox/fs-bridge.ts src/agents/sandbox/fs-bridge.test.tsHuman Verification (required)
What you personally verified (not just CI), and how:
bridge.mkdirp({ filePath: "/workspace/skills" })succeeds when directory already exists; verified docker command path arg remains/workspace/skills.Compatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
src/agents/sandbox/fs-bridge.ts,src/agents/sandbox/fs-bridge.test.ts,CHANGELOG.md.Risks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.mkdirpcould accidentally relax safety checks.