[Ubuntu 24.04][Sandbox] snapshot restore does not remove files added after the snapshot — regression of #1902
- Dominant language
- TypeScript
- Stars
- 22.5k
- Forks
- 3.1k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 715
Description
> [!WARNING]
> **Regression** — this bug was fixed in #1902 (April 2026), but has resurfaced in v0.0.76.
## Description
`nemoclaw snapshot restore` succeeds (exit 0, reports "Restored 14 directories, 1 files") but does not delete files that were added to the sandbox after the snapshot was created. A file written to `/sandbox/.hermes-data/workspace/` after snapshot creation survives the restore and is still present afterwards. This is a regression of the fix for #1902, which corrected the same tar-overlay semantics problem.
Platform scope: Reproduced on Ubuntu 24.04 (ubuntu22 and ubuntu24 CI runners); DGX Spark hit a different error on the same test. Other platforms not tested.
## Environment
```text
Device: Ubuntu 24.04 server (x86_64 CI runner)
OS: Ubuntu 24.04
Architecture: x86_64
Node.js: v22.22.3
npm: 10.9.8
Docker: 28.3.3
OpenShell CLI: 0.0.72
NemoClaw: v0.0.76
OpenClaw: 2026.6.10
```
## Steps to Reproduce
1. `nemoclaw onboard --name test-sandbox --non-interactive --yes`
2. `nemoclaw test-sandbox snapshot create --name baseline`
3. `nemoclaw test-sandbox connect`
4. Inside sandbox: `echo "stale content" > /sandbox/.hermes-data/workspace/stale-file.txt`
5. `exit`
6. `nemoclaw test-sandbox snapshot restore baseline --yes`
7. `nemoclaw test-sandbox connect`
8. Inside sandbox: `ls /sandbox/.hermes-data/workspace/stale-file.txt`
## Expected Result
Step 8: `stale-file.txt` should not exist — snapshot restore must revert the sandbox to the exact state at snapshot creation time, removing any files added afterwards.
## Actual Result
Step 6 output:
```text
Using snapshot v1 (2026-07-08T02-41-26-204Z)
Restoring snapshot into 'test-sandbox'...
Restored 14 directories, 1 files
OpenClaw config permissions restored
```
Step 8: `stale-file.txt` is PRESENT — the file survived the restore. The restore used tar overlay semantics (only overwrites files in the archive) instead of clean-state semantics (delete everything, then extract).
## Logs
```text
$ nemoclaw test-sandbox snapshot restore baseline --yes
Using snapshot v1 (2026-07-08T02-41-26-204Z)
Restoring snapshot into 'test-sandbox'...
Restored 14 directories, 1 files
OpenClaw config permissions restored
$ nemoclaw test-sandbox connect
sandbox@test-sandbox:~$ cat /sandbox/.hermes-data/workspace/stale-file.txt
stale content
```
---
[NVB#6428493](https://nvbugspro.nvidia.com/bug/6428493)
Contributor guide
Assessment
This issue has not been assessed yet.