Repository navigation
Description
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
- OpenClaw (
@openclaw/openshell-sandboxplugin), behavior confirmed on versions<= 2026.6.6 - OpenShell backend, versions
>= 0.0.37(released on 2026-05-08)
When mirror is used as the OpenShell sandbox sync mode, the current behavior of the @openclaw/openshell-sandbox plugin appears to package the workspace and synchronize it with the sandbox through upload/download operations.
After the OpenShell upload behavior change introduced in v0.0.37 , this now causes an unexpected side effect: a subdirectory containing the previous sandbox workspace state is created inside the sandbox workspace. After each sync, that subdirectory is nested again, so the directory depth keeps increasing over time.
This does not look like intended behavior.
This appears to be related to the OpenShell upload behavior change introduced by:
- fix(cli): preserve source directory on sandbox upload NVIDIA/OpenShell#952
- fix(cli): preserve directory basename for filtered uploads NVIDIA/OpenShell#1028
Steps to reproduce
-
Deploy OpenClaw (
<= 2026.6.6) with an OpenShell backend (>= 0.0.37), and use the following OpenClaw settings:agents.defaults.sandbox.mode: allagents.defaults.sandbox.backend: openshellagents.defaults.sandbox.workspaceAccess: roplugins.entries.openshell.config.mode: mirror
-
Start an agent session.
-
Ask the agent to create or modify any file in the workspace directory.
-
Ask the agent to create or modify any file in the workspace directory a second time.
-
Inspect the agent sandbox workspace directory.
Expected behavior
The sandbox workspace directory should only contain the current workspace contents, such as the expected Markdown files and directories (for example Skills-related directories and other normal workspace files).
It should not accumulate historical copies of the previous workspace state inside itself.
Actual behavior
A directory named after the upload ID appears inside the sandbox workspace directory. Its contents correspond to the previous sandbox workspace state before the latest sync.
After each additional sync, the same pattern repeats and the previous workspace snapshot is nested one level deeper. Over time, the sandbox workspace ends up containing recursively nested historical workspace directories.
In other words, each sync introduces another level of self-nesting, and the directory structure keeps growing in depth.
OpenClaw version
2026.6.6
Operating system
Ubuntu
Install method
k8s
Model
irrelevant
Provider / routing chain
irrelevant
Additional provider/model setup details
No response
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
No response
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 23, 2026
Thanks for the context here. I did a careful shell check against current
main, and this is already implemented.Current main fixes the OpenShell mirror self-nesting problem: the upload path no longer sends the generated
openclaw-openshell-upload-*staging directory as the remote workspace root, and merged maintainer PR #96303 provides the fix provenance. The latest release still has the old upload shape, so this is fixed on current main only until the next release.So I’m closing this as already implemented rather than keeping a duplicate issue open.
Review details
Best possible solution:
Keep the current main OpenShell plugin implementation and let the next release ship the fixed mirror upload behavior.
Do we have a high-confidence way to reproduce the issue?
Yes. The old release source uploaded a generated staging directory and upstream OpenShell now preserves named directory basenames; linked PR proof also exercised the behavior against OpenShell v0.0.68, while current main has the corrected upload shape.
Is this the best way to solve the issue?
Yes. The current plugin-owned fix avoids uploading the generated staging root and preserves workspace cwd compatibility, which is narrower than the earlier
upload .candidate PRs.Security review:
Security review: No PR patch security review applies to this issue cleanup.
AGENTS.md: found and applied where relevant.
What I checked:
extensions/openshell/src/backend.ts:750, 3ab8d6aa609a)extensions/openshell/src/backend.ts:658, 3ab8d6aa609a)fix(openshell): preserve uploaded workspace root, and records real OpenShell E2E proof in its maintainer landing comment. (3176e5db5cff)extensions/openshell/src/backend.ts:750, 8ecbf83c678c)v2026.6.10was published before the fix and still stages directly intotmpDir, so no release tag contains the current-main proof SHA and this fix is main-only for now. (extensions/openshell/src/backend.ts:743, aa69b12d0086).and file uploads remain flat.Likely related people:
fix(openshell): preserve uploaded workspace rootcommit, and recently touched adjacent OpenShell backend/release surfaces. (role: fix owner and recent area contributor; confidence: high; commits: 3176e5db5cff, 4712df228cad, ce32697250d5; files:extensions/openshell/src/backend.ts,extensions/openshell/src/backend.e2e.test.ts,extensions/openshell/src/backend.types.ts)extensions/openshell/src/backend.ts,extensions/openshell/src/mirror.ts,extensions/openshell/src/mirror.test.ts)extensions/openshell/src/backend.ts,extensions/openshell/src/config.ts)extensions/openshell/src/backend.ts)Codex review notes: model internal, reasoning high; reviewed against 3ab8d6aa609a; fix evidence: commit 3ab8d6aa609a, main fix timestamp 2026-06-25T00:32:29+02:00.
fix(openshell): prevent recursively nested directories in mirror uploads