Skip to content

fix(snapshot): clarify OpenClaw workspace persistence - #8245

Merged
jyaunches merged 8 commits into
mainfrom
codex/issue-8136
Aug 5, 2026
Merged

fix(snapshot): clarify OpenClaw workspace persistence#8245
jyaunches merged 8 commits into
mainfrom
codex/issue-8136

Conversation

@apurvvkumaria

@apurvvkumaria apurvvkumaria commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

OpenClaw's managed shell uses /sandbox as its home while durable workspace files live under /sandbox/.openclaw/workspace. This change makes that boundary explicit and adds the missing live regression for preserving USER.md and SOUL.md through snapshot creation, sandbox destruction, fresh same-name onboarding, and restore.

The snapshot scope remains manifest-defined; arbitrary files under /sandbox are not added to backups.

Related Issue

Related to #8136. The issue remains open pending reporter confirmation with the canonical OpenClaw workspace paths.

Changes

  • Warn OpenClaw users that ~/USER.md and ~/SOUL.md resolve outside the managed workspace and are not included in snapshots.
  • Direct users to $OPENCLAW_WORKSPACE_DIR/USER.md and $OPENCLAW_WORKSPACE_DIR/SOUL.md.
  • Extend the snapshot-commands live target to create those canonical files, destroy the source sandbox, freshly onboard the same name, restore the saved snapshot, and verify file contents and policy metadata.
  • Preserve the existing snapshot security boundary instead of capturing arbitrary sandbox-home files.
  • Keep credential-root documentation aligned with the enforced root:sandbox 0710 search-only root and root-only descendants.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification:
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: Independent Codex Desktop security review passed for validated commit 0bc10a053. The change preserves the manifest-defined snapshot scope, credential redaction, sandbox-name validation, shell quoting, cleanup registration, and the root-only credential descendant boundary.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: docs-updated
  • Evidence: docs/manage-sandboxes/backup-restore.mdx, docs/manage-sandboxes/workspace-files.mdx, and docs/security/credential-storage.mdx; verified OpenClaw workspace snapshot paths and confidentiality-root versus descendant permissions; npm run docs passed with 0 errors and 2 known nonblocking warnings.
  • Agent: Codex Desktop

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit: Not applicable; scripts/prepare-dgx-station-host.sh is unchanged.
  • Station profile/scenario: Not applicable.
  • Result: Not applicable.
  • Supporting evidence: Not applicable.

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run validate:pr passed after refreshing origin/main when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — the isolated support regression passed all 34 tests; semantic E2E phase validation covered 117 tests across 74 files; project membership, title style, test-size, source-shape, CLI type checking, documentation routes, formatting, secret scanning, and diff checks passed.
  • Applicable broad gate passed — the refreshed PR E2E gate is running and must pass before merge.
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only) — the build passed with zero errors and two known nonblocking Fern warnings.
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Apurv Kumaria akumaria@nvidia.com

Summary by CodeRabbit

  • Documentation

    • Clarified that ~ resolves to /sandbox, not the managed workspace, and files stored there are excluded from snapshots.
    • Recommended storing important files, including USER.md and SOUL.md, under $OPENCLAW_WORKSPACE_DIR.
  • Tests

    • Expanded snapshot coverage to verify workspace files are excluded from fresh environments and restored correctly from backups, including after a fresh onboarding flow.

Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@apurvvkumaria apurvvkumaria self-assigned this Aug 4, 2026
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 86df0262-5fe1-4c8e-907c-517b7c389a34

📥 Commits

Reviewing files that changed from the base of the PR and between 21ffb95 and 0bc10a0.

📒 Files selected for processing (2)
  • docs/security/credential-storage.mdx
  • test/e2e/live/snapshot-commands.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/e2e/live/snapshot-commands.test.ts

📝 Walkthrough

Walkthrough

The documentation clarifies that ~ resolves to /sandbox. Snapshot tests use OPENCLAW_WORKSPACE_DIR, verify canonical workspace files, and update credential-root permission expectations.

Changes

OpenClaw workspace snapshots

Layer / File(s) Summary
Managed workspace path documentation
docs/manage-sandboxes/backup-restore.mdx, docs/manage-sandboxes/workspace-files.mdx
Documents /sandbox path resolution and directs snapshot-managed files to $OPENCLAW_WORKSPACE_DIR.
Workspace snapshot recovery validation
test/e2e/live/snapshot-commands.test.ts
Adds canonical workspace fixtures and verifies their creation, clean replacement after onboarding, and recovery during snapshot restore.
Credential-root permission expectations
docs/security/credential-storage.mdx, test/e2e/live/snapshot-commands.test.ts
Documents and verifies root:sandbox ownership with 0710 permissions for credential roots while descendants remain root-only.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SnapshotE2E as Snapshot E2E test
  participant SourceSandbox as Source sandbox
  participant Onboarding as Fresh onboarding
  participant SnapshotRestore as Snapshot restore
  SnapshotE2E->>SourceSandbox: Destroy source sandbox
  SnapshotE2E->>Onboarding: Perform fresh non-interactive onboarding
  Onboarding-->>SnapshotE2E: Return replacement workspace
  SnapshotE2E->>SnapshotRestore: Restore timestamped snapshot
  SnapshotRestore-->>SnapshotE2E: Recover marker, USER.md, and SOUL.md
Loading

Suggested labels: area: sandbox

Suggested reviewers: aasthajh

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: clarifying OpenClaw workspace persistence and snapshot behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/issue-8136

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

@github-code-quality

github-code-quality Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 0bc10a0 in the codex/issue-8136 branch remains at 96%, unchanged from commit 62b4f28 in the main branch.

TypeScript / code-coverage/cli

The overall coverage in commit 0bc10a0 in the codex/issue-8136 branch remains at 81%, unchanged from commit 62b4f28 in the main branch.

Show a code coverage summary of the most impacted files.
File main 62b4f28 codex/issue-8136 0bc10a0 +/-
src/lib/platform.ts 89% 84% -5%
src/lib/shields/index.ts 74% 73% -1%
src/lib/messagi...nnels/policy.ts 100% 100% 0%
src/lib/sandbox...rce-identity.ts 87% 87% 0%
src/lib/tunnel/services.ts 80% 80% 0%
src/lib/credentials/store.ts 55% 56% +1%

Updated August 05, 2026 07:41 UTC

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Informational

Advisor assessment: Informational / low confidence
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions
Status: PR review advisor skipped: OpenShell inference configuration failed or the advisor credential is unavailable

Model lanes

  • GPT-5.6 Terra (primary): Skipped
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions

Second-opinion terminology and E2E selections are advisory. They do not change the primary assessment or E2E / PR Gate.

E2E guidance

Advisory only. E2E / PR Gate selects and runs jobs independently.

Recommended E2E: snapshot-commands

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

@wscurran wscurran added bug-fix PR fixes a bug or regression integration: openclaw OpenClaw integration behavior labels Aug 4, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Aug 5, 2026
23 tasks
senthilr-nv and others added 4 commits August 4, 2026 23:00
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@apurvvkumaria

Copy link
Copy Markdown
Collaborator Author

Resolved the failing snapshot E2E and refreshed the branch from current main.

Failure classification: PR-related expectation drift, not infrastructure or test flakiness. The confidentiality-root contract introduced by #7603 keeps every present credential root at root:sandbox 0710 so the sandbox group can traverse it, while every descendant remains root:root without group or world permission bits. The failed E2E artifact reported the intended root posture, but this test still expected root:root 0700 before and after backup.

The branch now:

  • expects root:sandbox 0710 for the credential root at both validation points;
  • continues to require root:root 0600 for the credential file;
  • documents the same root-versus-descendant boundary;
  • preserves the existing redaction, unreadability, snapshot-scope, and cleanup assertions.

Validation completed locally: PR-scoped hooks, CLI type checking, semantic E2E phase coverage (117 tests across 74 files), project membership, test-title and size checks, source-shape checks, documentation build and route validation, and the isolated 34-test support regression. GitHub reports all newly pushed commits as Verified. The refreshed CI and E2E gates are now running.

@apurvvkumaria

Copy link
Copy Markdown
Collaborator Author

CI classification update: the primary advisor retry failed before analysis because the upstream inference service rejected the workflow credential with HTTP 403. The second-opinion lane completed successfully with zero blockers, warnings, or suggestions, and the published advisor result requires no follow-up. This is an advisor-infrastructure failure, not a failure caused by this PR. All required checks currently pass except the selected snapshot E2E scenario, which is still running; I will continue monitoring it.

@apurvvkumaria

Copy link
Copy Markdown
Collaborator Author

Settled merge-gate status for the current branch revision:

  • Required repository CI, CodeQL, documentation review, DCO, commit verification, and the selected snapshot E2E gate pass.
  • CodeRabbit has no actionable findings, and the completed Nemotron advisor lane reported zero blockers, warnings, or suggestions.
  • The Terra advisor failure is external to this change: its first attempt ended inside advisor analysis, and the single retry failed while configuring the external inference service. No further transient rerun is warranted.
  • There are no unresolved review threads.

The remaining merge blocker is independent approval: GitHub reports REVIEW_REQUIRED, and the PR author cannot self-approve. I have not added or re-requested any reviewer; repository-owned routing should supply that review.

@jyaunches
jyaunches merged commit d71d892 into main Aug 5, 2026
99 of 101 checks passed
@jyaunches
jyaunches deleted the codex/issue-8136 branch August 5, 2026 12:44
@cjagwani cjagwani mentioned this pull request Aug 5, 2026
23 tasks
cjagwani added a commit that referenced this pull request Aug 5, 2026
<!-- markdownlint-disable MD041 -->
## Summary

Add the canonical dated changelog entry for the planned NemoClaw
v0.0.103 release.
The new `docs/changelog/2026-08-05.mdx` entry uses the exact `##
v0.0.103` heading and summarizes supported user-visible changes merged
since v0.0.102.

## Changes

- Add the parser-safe MDX SPDX header, three-paragraph release summary,
and detailed grouped bullets to `docs/changelog/2026-08-05.mdx`.
- Link each release-note group to the most specific published OpenClaw,
Hermes, or Deep Agents documentation routes.
- Exclude dormant MXC and Podman foundations, internal managed-inference
adapters, test-only changes, and maintainer tooling from the supported
product narrative.

### Source summary

- [#8082](#8082) ->
`docs/changelog/2026-08-05.mdx`: Document the new one-command agent
launch flow.
- [#8314](#8314) ->
`docs/changelog/2026-08-05.mdx`: Document managed vLLM host capability
validation and restart handling.
- [#8248](#8248) ->
`docs/changelog/2026-08-05.mdx`: Record the DGX Spark Qwen profile MTP
default change.
- [#8223](#8223) ->
`docs/changelog/2026-08-05.mdx`: Record explicit model preservation
across provider switches.
- [#8209](#8209) ->
`docs/changelog/2026-08-05.mdx`: Document corrected Windows WSL provider
selection.
- [#8316](#8316) ->
`docs/changelog/2026-08-05.mdx`: Record clean managed-checkout reuse
after installation.
- [#8239](#8239) ->
`docs/changelog/2026-08-05.mdx`: Record the packaged-service teardown
fallback.
- [#8247](#8247) ->
`docs/changelog/2026-08-05.mdx`: Document uninstall behavior for an
already-removed sandbox.
- [#7998](#7998) ->
`docs/changelog/2026-08-05.mdx`: Record preserved container-start
diagnostics.
- [#8027](#8027) ->
`docs/changelog/2026-08-05.mdx`: Record journal-backed not-ready repair
authority.
- [#7812](#7812) ->
`docs/changelog/2026-08-05.mdx`: Document actionable rebuild preflight
diagnostics.
- [#8222](#8222) ->
`docs/changelog/2026-08-05.mdx`: Record redacted top-level CLI failures.
- [#8313](#8313) ->
`docs/changelog/2026-08-05.mdx`: Record structured MCP bridge
destruction failures.
- [#8211](#8211) ->
`docs/changelog/2026-08-05.mdx`: Document cleanup of incomplete snapshot
captures.
- [#8212](#8212) ->
`docs/changelog/2026-08-05.mdx`: Document best-effort post-restore
policy reconciliation.
- [#8245](#8245) ->
`docs/changelog/2026-08-05.mdx`: Clarify manifest-defined OpenClaw
workspace persistence.
- [#8254](#8254) ->
`docs/changelog/2026-08-05.mdx`: Include corrected snapshot restore
selection guidance.
- [#8238](#8238) ->
`docs/changelog/2026-08-05.mdx`: Document preservation of managed MCP
policy entries.
- [#7568](#7568) ->
`docs/changelog/2026-08-05.mdx`: Record mutable-default Shields rollback
preservation.
- [#8200](#8200) ->
`docs/changelog/2026-08-05.mdx`: Record truthful Shields state after a
rejected transition.
- [#7895](#7895) ->
`docs/changelog/2026-08-05.mdx`: Record descriptor-bound Shields lock
inspection.
- [#7892](#7892) ->
`docs/changelog/2026-08-05.mdx`: Document the canonical Hermes dashboard
profile and migration.
- [#7871](#7871) ->
`docs/changelog/2026-08-05.mdx`: Document fail-closed Hermes cron
restore.
- [#7894](#7894) ->
`docs/changelog/2026-08-05.mdx`: Record the reset Hermes health budget
after recovery.
- [#8228](#8228) ->
`docs/changelog/2026-08-05.mdx`: Document Hermes build-time corporate CA
trust.
- [#8206](#8206) ->
`docs/changelog/2026-08-05.mdx`: Document bounded Deep Agents Code
failure classification.
- [#8297](#8297) ->
`docs/changelog/2026-08-05.mdx`: Record reuse of the published Deep
Agents Code base image.
- [#8321](#8321) ->
`docs/changelog/2026-08-05.mdx`: Document aligned endpoint SSRF
protections and userinfo rejection.
- [#8299](#8299) ->
`docs/changelog/2026-08-05.mdx`: Document the fail-closed `setpriv`
transition in managed images.
- [#7603](#7603) ->
`docs/changelog/2026-08-05.mdx`: Record corrected confidentiality-root
traversal.
- [#8334](#8334) ->
`docs/changelog/2026-08-05.mdx`: Record removal of the unsupported logs
audit example.
- [#8256](#8256) ->
`docs/changelog/2026-08-05.mdx`: Record reordered network-policy
walkthrough prerequisites.
- [#7767](#7767) ->
`docs/changelog/2026-08-05.mdx`: Record platform runtime shape
validation.

## Type of Change

- [ ] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [x] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)

## Quality Gates

- [ ] Tests added or updated for changed behavior
- [x] Existing tests cover changed behavior — justification: `npx vitest
run test/changelog-docs.test.ts` passed all 6 tests.
- [ ] Tests not applicable — justification:
- [x] Docs updated for user-facing behavior changes
- [ ] Docs not applicable — justification:
- [ ] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [ ] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification:
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Documentation Writer Review

- [ ] Documentation writer subagent reviewed the completed changes
- Result: `docs-updated`
- Evidence: `docs/changelog/2026-08-05.mdx` follows the release-prep and
documentation writing rules. The changelog contract tests passed 6/6,
and `npm run docs` completed with 0 errors and the repository's 2
existing Fern warnings.
- Agent: Codex Desktop
<!-- docs-review-head-sha: 66fcd80 -->
<!-- docs-review-agents-blob-sha: 3dd7c24 -->

## DGX Station Hardware Evidence

- [ ] Tested on DGX Station
- Tested commit: Not applicable.
- Station profile/scenario: Not applicable.
- Result: Not applicable.
- Supporting evidence: Not applicable.

## Verification

- [x] PR description includes a `Signed-off-by:` line and every commit
appears as `Verified` in GitHub
- [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or
`npm run validate:pr` passed after refreshing `origin/main` when hooks
were skipped or unavailable
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above — `npx vitest run
test/changelog-docs.test.ts`: 1 file and 6 tests passed.
- [ ] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — command/result: Not run for this doc-only
change.
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only) —
completed with 0 errors and 2 existing Fern warnings.
- [x] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)
— the native changelog uses the required parser-safe MDX SPDX comment
and does not use page frontmatter.

---
Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
  * Added release notes for v0.0.103.
  * Documented the new `nemoclaw launch` command.
* Included updates covering onboarding, inference, installation,
recovery, snapshots, security, integrations, endpoint validation,
sandbox hardening, and related guidance.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix PR fixes a bug or regression integration: openclaw OpenClaw integration behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants