Repository navigation
Commit b37e142
## Context
Part of #7073. A legacy `v0.0.55 → current` upgrade recreates the
managed sandbox and restores it from a pre-upgrade backup. That backup
scopes to `/sandbox/.openclaw` only (see `rebuild-backup-phase.ts`
manifest `dir: "/sandbox/.openclaw"`), so any files the user keeps
elsewhere in the sandbox (e.g. `/sandbox/user-data`) are dropped by the
recreate with no prior notice.
I reproduced the loss on real hardware: after a legacy-recreate,
non-`.openclaw` paths are absent from the recreated sandbox while
`.openclaw` state is restored intact.
> Note: the **messaging-channel** loss facet of #7073 is being addressed
separately via the maintainer's recommended `v0.0.63` migration bridge
(which writes the plan-based `messaging` registry entry that #5123 made
authoritative). I validated that bridge on a fresh `v0.0.63` install and
reported the migrated-sandbox residual behavior in the issue thread.
This PR does **not** claim to close that facet, so it does not `Fixes
#7073`.
## Change
Print a warning in the prepared-backup-recovery summary. It shows in
both `upgrade-sandboxes --check` (dry run) and the real recreate,
immediately after the list of sandboxes that will be recovered — i.e.
before the destructive step — so users can back up non-`.openclaw` paths
externally first.
```
Prepared backup recovery:
my-assistant 2026-07-17T08-27-20-142Z (non-Ready)
⚠ Recovery restores /sandbox/.openclaw state only. Files outside .openclaw
(e.g. /sandbox/user-data) are NOT preserved by the recreate — back them up
before upgrading.
```
## Verification
- New unit test drives the real `upgradeSandboxes` through the
prepared-recovery branch and asserts the warning is emitted.
- Verified end-to-end on an x86_64 Ubuntu 24.04 host: forced a
registered sandbox non-Ready with a validated backup and confirmed the
live binary prints the warning in the `--check` output.
- `typecheck:cli` and the full `upgrade-sandboxes-recovery` suite (35
tests) pass.
## Independent validation
The reporter independently ran the full `v0.0.55 → v0.0.63 → v0.0.81`
bridge on their own hardware and confirmed: the messaging bridge
preserves the Slack channel (schema-v1 `messaging.plan` written on the
v0.0.63 re-apply, survives to v0.0.81), while `/sandbox/user-data`
seeded before the final upgrade is still lost afterward — i.e. the
non-`.openclaw` data loss this PR warns about is the tracked concern of
the issue, and an external backup remains required.
## Scope
Deliberately narrow: a warning only. It does not change backup scope or
restore behavior (widening the backup to cover arbitrary sandbox paths
is a larger design decision about what the managed lifecycle owns). This
just closes the silent-data-loss gap by making the boundary explicit
before the irreversible recreate.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved sandbox upgrade/recovery messaging by adding a warning that
recreate restores only the validated managed-state directory recorded in
the recovery manifest, not other directories such as
`/sandbox/user-data`, and reminding users to back up those paths
beforehand.
* **Tests**
* Enhanced the recovery test harness to support per-agent restore
manifest directories and added a parameterized test (issue `#7073`)
verifying upgrade warning order and that `rebuildSandbox` runs only in
`{ auto: true }` mode (none in `{ check: true }`).
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Signed-off-by: Yanyun Liao <[email protected]>
---------
Signed-off-by: Apurv Kumaria <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
Co-authored-by: Apurv Kumaria <[email protected]>
1 parent aa3dd78 commit b37e142
2 files changed
Lines changed: 112 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
16 | 23 | | |
17 | 24 | | |
18 | 25 | | |
19 | 26 | | |
20 | 27 | | |
21 | | - | |
| 28 | + | |
22 | 29 | | |
23 | 30 | | |
24 | 31 | | |
25 | 32 | | |
26 | 33 | | |
27 | | - | |
| 34 | + | |
28 | 35 | | |
29 | 36 | | |
30 | 37 | | |
| |||
40 | 47 | | |
41 | 48 | | |
42 | 49 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
53 | 63 | | |
54 | 64 | | |
55 | 65 | | |
| |||
107 | 117 | | |
108 | 118 | | |
109 | 119 | | |
110 | | - | |
111 | | - | |
112 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
113 | 126 | | |
114 | 127 | | |
115 | 128 | | |
| |||
190 | 203 | | |
191 | 204 | | |
192 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
193 | 282 | | |
194 | 283 | | |
195 | 284 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
367 | 374 | | |
368 | 375 | | |
369 | 376 | | |
| |||
0 commit comments