Repository navigation
fix(update): keep the rehearsal Doctor from retiring workspace files outside the rehearsal root - #145606
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 12, 2026, 2:10 AM ET / 06:10 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR confines rehearsal Doctor migrations to copied state, preserving live workspace files and recovery records until the real post-install migration. Merge readiness⛔ Blocked before merge - 1 item remains This remains a necessary update data-loss fix. No actionable introduced defect was found, and the recorded published-updater upgrade satisfies the previous compatibility-proof request. Priority: P0 Review scores
Verification
How this fits togetherOpenClaw rehearses updates using copied state before replacing the installed package. Doctor processes retained workspace and skill records during that rehearsal and again against real state after installation. flowchart TD
A[Installed updater] --> B[Copied state and retained paths]
B --> C[Rehearsal Doctor]
C --> D{Path inside copied root?}
D -->|Yes| E[Migrate copied state]
D -->|No| F[Preserve files and recovery records]
E --> G[Install candidate]
F --> G
G --> H[Real Doctor migrates operator state]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +265, Tests +532, Docs +7. Total +804 across 15 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep one Doctor migration owner with phase-specific write scope, preserving live recovery state until installation completes. Do we have a high-confidence way to reproduce the issue? Yes: copied proposal records retain live absolute paths that current-main Doctor can recover or relocate without rehearsal containment. Source and recorded regressions establish the mechanism; this review did not execute it. Is this the best way to solve the issue? Yes: sharing the shipped rehearsal contract with existing migration owners avoids rewriting persisted paths or requiring changes to an already-installed updater. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c0c032415550. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Keep persisted paths outside the rehearsal namespace as read-only inventory until the real Doctor runs. Cover setup import, proposal recovery, sidecars, collection backups, and prepared relocation receipts through one path scope. The standalone historical-workspace recovery already exists in #145084. This fixes the update rehearsal that otherwise consumed the live sources. Refs #142585. Refs #145084. Thanks to @xbb19730559 and @itilys for the reproduction evidence.
da7f3f2 to
d5702e9
Compare
|
Merged via squash.
|
…nclaw#145606) During an update, the candidate's rehearsal Doctor no longer follows absolute workspace paths stored in the copied state back into the live workspace. Files outside the rehearsal root are read-only inventory and are recorded as such; the real post-update Doctor migrates them as before. Recognize the isolation contract already shipped by the 2026.9.3 and 2026.9.4 update drivers. Preserve external setup files, Workshop skills, backups, and recovery records through rehearsal without changing normal Doctor migration. Proof: preservation regressions and owned-path migration controls, recorded published-2026.9.3 Docker upgrade with all five live fixture files preserved through 51 rehearsal observations, successful real Doctor migration, and exact-head CI. Refs openclaw#142585 openclaw#145084. Thanks @xbb19730559 and @itilys for the reports and reproduction evidence.
What Problem This Solves
Fixes an issue where users updating from 2026.9.3 could lose active Workshop skill files during candidate rehearsal even though the update reported success. Copied proposal records retained absolute live-workspace paths, so the rehearsal retired the original setup files and moved live skills into its disposable directory.
#145084 already provides the standalone Doctor recovery for the historical-workspace shape in #142585. This PR fixes update-path isolation.
Why This Change Was Made
The rehearsal owner now shares its existing filesystem namespace contract with Doctor. Persisted paths outside the copied root remain read-only inventory, with both lexical and physical containment checked. This includes setup import, pending rollback recovery, sidecar/index migration, skill relocation, collection backups, and prepared relocation receipts. Paths inside the copied root still migrate normally.
Doctor records a typed count and a notice:
rehearsal: N legacy files outside the rehearsal root left untouched. The post-swap real Doctor retains the existing import, archival, and relocation behavior.This is candidate-side: the 9.3/9.4 drivers run the candidate's Doctor, including their pre-plugin phase. Their installed snapshot producer supplies no new marker or workspace map, so the guard recognizes the complete isolation environment they already ship. The current producer uses that same shared contract; no new environment option is introduced.
User Impact
Update rehearsal preserves the operator's workspace files and recovery history. The real Doctor then records the correct receipts in the real database, preserves archived setup bytes, and keeps Workshop skills available after the update.
Evidence
/readyz200.tbx_01m29zt3crcg8r1myrdq8sd3sq(run): unchanged published 9.3 updater exit 0 /status: okin 28.903 seconds; swap 5.714 seconds; real Doctor exit 0. All 51 rehearsal observations preserved five original files. Final verification found 2 completed/removed receipts, both archive hashes preserved, 3 applied skills intact, correct separate workspace milestones, and Gateway/readyz200. Source commitda7f3f22f06ca17eefb78b11b83fdb8f48ed344awas verified by tree220c95506a465d7fe7282305a09987af95f05e2c; the Testbox carrier commit is an intentional wrapper identity. The command exited 0 and the lease completed; Testbox teardown stops its backing workflow. No product assertions or driver timeouts changed.node scripts/check-changed.mjs,pnpm build, and package tarball integrity checks passed. Fresh P1 autoreview on the final helper split: no accepted/actionable findings.Known limitation: the two local arm64 runs still expose the installed driver's #144758 timeout, which candidate code cannot repair in that running parent. The independent x64 full hop and standalone candidate control pass. No timeout, assertion, schema, dependency, or baseline changes are included in this PR. Previous-head CI completed red in checks-node-compact-large-4:
src/gateway/worker-environments/worker-turn-detached-context.test.tstimed out atworker functional launch observationafter 5,000 ms. That test was added on main by #145591 (aa7eabb1f6d) after this branch's base and is absent from the previous PR head; no worker-launch code is changed here. That run's aggregateopenclaw/ci-gatereflected the failure; other checks passed or skipped. The unrelated test was not altered or manually rerun.Rebased onto current main to resolve its independent receipt-field addition. Head
d5702e9108db181518df58c9089d0e2cc41c2cb0preserves the same implementation delta; range-diff shows only adjacent receipt context changed. The 10 rehearsal regressions,node scripts/check-changed.mjs, and fresh P1 autoreview all passed after reconciliation. The Docker artifact above remains accurately pinned to its pre-rebase source. Exact-head CI is green:node scripts/watch-pr-ci.mjs 145606 d5702e9108db181518df58c9089d0e2cc41c2cb0exited 0 withGREEN, zero pending checks, and six superseded contexts identified. The previous-head failure above remains historical evidence.Thanks @xbb19730559 for the evidence and @itilys for the related reproduction details. #142585 is assigned to @RomneyDa; this keeps the repair at the rehearsal and migration owners for review.
Refs #142585. Refs #145084.
ClawSweeper review
The review of
d5702e9108db181518df58c9089d0e2cc41c2cb0found no actionable introduced defect. Its remaining compatibility-proof request is addressed by the recorded published-9.3 upgrade cell above and the preservation/control regressions; no code fixup is needed.No Rank-up code changes remain. The existing arm64 installed-driver timeout limitation remains recorded above; it does not alter the rehearsal isolation result.