Repository navigation
fix: keep one missing archived transcript from blocking every update - #200733
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 Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR lets update rehearsal preserve missing archived transcripts with a warning and independently copies archive files on Windows. Example: An installation running 2026.11.4 has one file-backed cold transcript whose payload was deleted.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — verified: source commit Merge readiness✅ Ready for maintainer review This PR addresses a verified update regression still present on main. The updated live evidence supports the fix, and review found no blocking correctness or security defects. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe candidate snapshot worker reads live database archive references and projects their payloads into private rehearsal state consumed by candidate Doctor. flowchart LR
A[CLI or managed update] --> B[Candidate snapshot worker]
C[Live databases and archives] --> B
B --> D[Private rehearsal state]
B --> E[Recorded snapshot warnings]
D --> F[Candidate Doctor]
Technical reviewBest possible solution: Keep missing-path handling and Windows copy isolation in the existing snapshot worker while preserving archive rows, verification, and capacity accounting. Do we have a high-confidence way to reproduce the issue? The base performs an uncaught stat on each referenced archive, matching the supplied live ENOENT update failure; no target code was executed during this read-only review. Is this the best way to solve the issue? The fix restores faithful rehearsal through the existing owner, retains non-missing errors and archive integrity checks, and avoids Windows shared-inode cleanup effects. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 23886ceb98e5. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +36, Tests +75, Docs +4. Total +115 across 4 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 17, 2026, 2:19 PM ET / 19:19 UTC (Revision 2). |
|
@clawsweeper re-review Live proof is now in the PR body: base refuses an 11.4 update with one missing cold archive; the fix updates over CLI and managed |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…penclaw#200733) One archived (cold) transcript file that was already missing from live state no longer blocks every update: the rehearsal snapshot keeps it missing, reports a warning, and only a Doctor repair that reads that archive fails, as it would on live state. Dangling or unreachable links count as missing. On Windows the rehearsal always copies archives instead of hard-linking them, because removing a hard link on a filesystem without POSIX delete (for example an SMB share) clears the live file's read-only attribute. Follow-up to openclaw#200659. Refs openclaw#200594. Proof: 11.4 -> main with one missing archive refused at snapshot inventory (ENOENT); 11.4 -> fix succeeded over CLI and managed update.run with the warning. Native Windows Server 2025 probe confirmed the SMB read-only attribute loss through a hard link and none with a copy. Co-authored-by: Peter Steinberger <[email protected]>
* fix(update): include cold archives in candidate snapshots Co-authored-by: steipete <[email protected]> * fix(update): preserve file archives in rehearsal snapshots Co-authored-by: steipete <[email protected]> * fix(update): preserve source WAL state during archive inventory Classify cold archive SQL under its existing candidate-state subprocess owner. Preserve incomplete WAL source families so header inspection retains private cleanup custody. Co-authored-by: steipete <[email protected]> --------- Co-authored-by: steipete <[email protected]> Release adaptation: the baseline does not contain the #195487 header-cleanup suite. Keep that unrelated suite absent; carry the new incomplete-WAL inventory assertions into the existing inventory suite instead. Add a per-change 214-line allocation for the source regression, chunk fallback, and WAL preservation tests. No schema, updater protocol, authority, or archive-integrity changes. Companion audit at 9e917f0: - #200733 is selected as the next dependency-closure repair: missing archives must warn instead of blocking updates, and Windows copies must not share live read-only inode attributes. Do not qualify this intermediate checkpoint alone. - #200076 and #200930 are independent cold-history performance changes, not prerequisites for this snapshot repair. - #201009, #200994, #200866, #200577, #200805, #200802, and #200732 overlap only adjacent update documentation and independent repair flows; not prerequisites. Proof on base 309067b: - New production-subprocess regression: 4/4 fail before, 4/4 pass after. - Cold archives, chunks, and inventory: 31/31 pass after. - Additional budget/cleanup/import siblings: 46/47 pass. Configured-cache containment fails identically on the unchanged base at budget.test.ts:737; retained as an independent failure, not weakened or repaired here. - Targeted lint and format, documentation links, SQLite worker ratchet, and test-line ratchet pass. SQLite T1 counts remain 170; compatibility 15. - Worker typecheck was blocked at dependency custody, without guard bypass. Parent canonical core typecheck, typed lint (five files), and formatting passed with its owned dependencies. Full installed-upgrade/FRV proof remains pending the assembled candidate, including selected companion #200733. (cherry picked from commit 802e3f7) Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]>
…200733) One archived (cold) transcript file that was already missing from live state no longer blocks every update: the rehearsal snapshot keeps it missing, reports a warning, and only a Doctor repair that reads that archive fails, as it would on live state. Dangling or unreachable links count as missing. On Windows the rehearsal always copies archives instead of hard-linking them, because removing a hard link on a filesystem without POSIX delete (for example an SMB share) clears the live file's read-only attribute. Follow-up to #200659. Refs #200594. Proof: 11.4 -> main with one missing archive refused at snapshot inventory (ENOENT); 11.4 -> fix succeeded over CLI and managed update.run with the warning. Native Windows Server 2025 probe confirmed the SMB read-only attribute loss through a hard link and none with a copy. Co-authored-by: Peter Steinberger <[email protected]> Release backport onto 721efb2d5b3d53a768ef26f46ff19a22a8b8f404: - Preserve the exact upstream four-file patch (stable patch-id e52fafccfc30ffb527aabb16e9eac15d452de695); add only a separate 75-line allocation for its missing/dangling archive and Windows-copy regressions. - Bounded companion audit: existing missing-path classification, warning transport/redaction, capacity field, and private SQLite inspection owners support this change without further dependencies. No schema, updater protocol, authority, or archive-integrity changes. No unrelated performance companions. - Base regression: 4 intended failures / 3 passes. Missing and dangling payloads fail the production inventory subprocess; parent snapshot preparation refuses missing history; Windows selection shares the source inode instead of copying. - Independent OpenClaw review of the exact source patch and tests found no P0-P2 issues. Local review CLI unavailable; this is static independent review, not a helper-validated ClawSweeper result. - Formatting, documentation links, and test-line allocation pass. - Lint and inherited targeted typecheck cannot prepare declaration dependencies from this checkout's shared install; the wrapper refuses external symlinks. No dependencies were changed and the guard was not bypassed. Parent-owned qualified checks are still required. - The upstream installed-upgrade and native Windows SMB proof above is source provenance, not a rerun here. Native Windows and full release qualification remain parent-owned; Linux Windows-selection proof covers private-copy choice. Backport runtime proof: cold-archive, inventory, and chunk suites all pass (34/34, 138.29 seconds wall including compilation). The cold-archive file's seven cases traverse production inventory/snapshot subprocesses; Windows-copy selection is tested with a platform override, not a native SMB share. Source WAL preservation, corrupt payload failure, full copy fallback, warning output, and historical pluginBytes capacity remain covered. The original missing-file and Windows-selection regressions are green without weakening assertions. (cherry picked from commit 427c857) Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]> (cherry picked from commit 350c9f1) Release adaptation: none. Companion disposition: #200659 projects cold archive payloads and #200733 preserves missing payload warnings; #200662 retains the stable 11.5 upgrade bridge; #200786 keeps controlled npm install environment. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 67c71dddf43d6e4ebd6e45d438706ece0742bba6)
* fix(update): include cold archives in candidate snapshots Co-authored-by: steipete <[email protected]> * fix(update): preserve file archives in rehearsal snapshots Co-authored-by: steipete <[email protected]> * fix(update): preserve source WAL state during archive inventory Classify cold archive SQL under its existing candidate-state subprocess owner. Preserve incomplete WAL source families so header inspection retains private cleanup custody. Co-authored-by: steipete <[email protected]> --------- Co-authored-by: steipete <[email protected]> (cherry picked from commit 802e3f7) Release adaptation: none. Companion disposition: #200659 projects cold archive payloads and #200733 preserves missing payload warnings; #200662 retains the stable 11.5 upgrade bridge; #200786 keeps controlled npm install environment. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 7384191252d0eb5c3add0e64ff9402d4afa55886)
…200733) One archived (cold) transcript file that was already missing from live state no longer blocks every update: the rehearsal snapshot keeps it missing, reports a warning, and only a Doctor repair that reads that archive fails, as it would on live state. Dangling or unreachable links count as missing. On Windows the rehearsal always copies archives instead of hard-linking them, because removing a hard link on a filesystem without POSIX delete (for example an SMB share) clears the live file's read-only attribute. Follow-up to #200659. Refs #200594. Proof: 11.4 -> main with one missing archive refused at snapshot inventory (ENOENT); 11.4 -> fix succeeded over CLI and managed update.run with the warning. Native Windows Server 2025 probe confirmed the SMB read-only attribute loss through a hard link and none with a copy. Co-authored-by: Peter Steinberger <[email protected]> (cherry picked from commit 427c857) Release adaptation: none. Companion disposition: #200659 projects cold archive payloads and #200733 preserves missing payload warnings; #200662 retains the stable 11.5 upgrade bridge; #200786 keeps controlled npm install environment. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit badc5c39bc62a5573ab1f8d73a5233cd0b85a3a4)
…#200786) Co-authored-by: steipete <[email protected]> (cherry picked from commit 9107009) Release adaptation: none. Companion disposition: #200659 projects cold archive payloads and #200733 preserves missing payload warnings; #200662 retains the stable 11.5 upgrade bridge; #200786 keeps controlled npm install environment. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit fc54a13ecebe318ca0126947193bb66700018d2f)
…200733) Baseline adaptation: Treat already-missing single-file archives as a rehearsal warning, preserve missing descriptors, and keep independent copies on every platform. (cherry picked from commit 427c857) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit ebb0d124256315587f2af26e72385b955520df0c)
…aw#194058) Failed-update triage now captures the operator's environment before managed candidate admission, so a coding agent installed only on the operator's PATH is still offered when the Gateway service's PATH differs. Restores the operator-environment contract from openclaw#134490 and keeps the launch confirmation from openclaw#143139. Proof: shipped CLI on isolated Linux (Crabbox) with a running systemd Gateway: accept launches the operator-only agent, decline starts nothing, base 18bee8e reports no agent found; published 2026.11.1 upgrades to the fix with settings intact. Co-authored-by: TorstenW <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: steipete <[email protected]> (cherry picked from commit 7c702c3) Release adaptation: Capture invoking operator env before candidate admission, forward to interactive triage only; preserve latest target selectors, confirmation and lease cleanup ordering. Exact three authorized production paths plus real lifecycle regression. Follow-up dispositions: ad4863d fix: preserve the running installation when an agent updates its Gateway (openclaw#201570); dc73ec0 fix: let updates finish when another tool briefly reads OpenClaw's databases (openclaw#202541); d07b530 fix: clarify PostgreSQL schema upgrades for Git installs (openclaw#202098); e60ea9f test(update): add a Git release upgrade-survivor scenario (openclaw#201956); 2ef6f7b fix(update): build and serve Git releases outside node_modules (openclaw#201917); dbc1aa0 fix: keep the openclaw command and Gateway working after updating a pnpm install (openclaw#201735); f5e7641 fix: Git checkout updates across a schema change no longer end as post-update-failed after the new release starts (openclaw#201600); 2183caf fix: Git checkout updates no longer fail before the new release starts on a schema change or a busy database (openclaw#201463); 47e8649 fix: explain why Doctor cannot restore a scheduled job’s account (openclaw#201550); 8f2cfd4 fix: remove updater-only restrictions from agent maintenance guidance; cb5cfb2 fix: keep a doubtful killed-update recovery on the repair path (openclaw#201361); 24cb734 fix: keep carried-over scheduled jobs running after updates (openclaw#200653); d1276e1 feat(doctor): check OpenClaw ID member roles and honor an optional roles default (openclaw#197785); 0a39956 fix: finish updates when another tool reads OpenClaw's databases during the update (openclaw#201330); ea1c9d5 fix(update): settle remounted package publications before admission (openclaw#201336); 66b5212 fix(update): isolate malformed retained-install markers (openclaw#201199); 7e79c83 fix: let the next update finish a killed source checkout update (openclaw#201009); d905d8a fix: let the next update finish a killed update after the machine restarted (openclaw#200994); fdf0c95 fix: let the next update finish a killed update that had already installed the new version (openclaw#200866); 0c19bcd chore(release): close out 2026.11.5 on main (openclaw#200577); a1940e0 fix(matrix): keep explicit recovery available during deferred migration (openclaw#200805); 18b4776 improve: explain package baseline drift during updates (openclaw#200802); 1ad4cad fix(doctor): reclaim macOS updater runtimes blocked by non-updater processes (openclaw#200732); 427c857 fix: keep one missing archived transcript from blocking every update (openclaw#200733); 802e3f7 fix(update): keep valid cold archives from blocking updates (openclaw#200659); 23fca1a fix: let the next update continue after a killed update when nothing is left to repair (openclaw#200680); 3afe212 fix: let Doctor publish unchanged plugin migrations in any order (openclaw#200658); f65e4db fix(doctor): reclaim runtimes blocked by unrelated Linux processes (openclaw#200657); dab086c fix(update): let candidate Doctor read plugin dependencies from the staged package (openclaw#200595); 3447bee fix(update): keep updates going when the predecessor writes during its stop (openclaw#200569); 0ce9c77 fix: let the next update settle a package publication that a killed update left behind (openclaw#200550); ae31ea3 fix(update): repair handoffs in the journal-pinned lease store (openclaw#200532); 74020ea fix: continue updates when initial SQLite capture is stale (openclaw#200328); 6747b1e feat(update): run Git checkout installs from releases behind the release link (openclaw#199706); e3f8a67 fix(state): keep completed retained agent stores out of startup upgrade (openclaw#200284); 3c512c5 fix(gateway): move managed update lease operations off the main thread (openclaw#200169); ea69fcb chore(release): close out 2026.11.4 on main (openclaw#199956); 618bf31 fix(state): bound startup upgrade copies and pruning to owned state (openclaw#199929); e4a3093 perf(update): replace the candidate canary with a runtime contract check (openclaw#198268); 5dbf569 fix(update): plugin failures never fail an update or Gateway health; 764761e fix(update): refuse missing host prerequisites in one line and record a cause per attempt; 4c4fef4 fix(ui): update dialog claims installation before progress is confirmed (openclaw#199254); 136e1f6 fix(update): retrying an update from a dev checkout is refused after a killed update (openclaw#198673); 3bd03da fix(update): avoid duplicate database copies while the Gateway is stopped (openclaw#198148); 68a839b fix: isolate held agent databases until explicit restoration (openclaw#198180); e333f7e chore(ci): drop retired test-lines allocation records (3/3) (openclaw#197657); fd6fa47 fix: converge Gateway updates with environment-only service overrides (openclaw#196371); 7cf5e75 fix: clarify split-install updates and blocked Doctor repairs (openclaw#196342); 6ff8c86 fix(update): retain lazy sqlite catalog generation (openclaw#197095); 930e1f7 fix: keep stable updates and recovery free of premature migrations (openclaw#196474); a15f737 fix: preserve external plugin data during update rehearsal (openclaw#196301); 92798ae fix: updates survive interrupted heartbeat runs (openclaw#195656); c1e55e2 fix(update): restore LaunchAgent registration after repair contention (openclaw#195406); 715c610 fix(doctor): repair retained ISO session end timestamps (openclaw#194685); 689cfc8 fix(update): reclaim dead closing triage repair leases (openclaw#194503); 86bc89e fix(doctor): keep standing Codex parameter advice out of retirement blockers (openclaw#193650); 691bc8d fix(backup): read the backup engine without copying the live database (openclaw#194234); 000542f fix(backup): backups and updates fail on slow storage when a header probe batch misses its deadline (openclaw#194239); 31a65d5 fix(update): skip --no-lazy-fetch on Git versions without it (openclaw#194198); e45e99d fix(update): preserve dev update sources in tag-only Git clones (openclaw#193109) Validation: Baseline2 intended operator-agent failures/32 controls passed; candidate34/34passed (194058-green.log). Accept launches synthetic operator-only CLI with expected env, decline starts nothing. Isolated updater flow, not live systemd/upgrade qualification. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 6689fd575ada8fe40a9593784deac18ec73041cd) (cherry picked from commit 92e7a9fa223b0dc35801f25f70be90b472d9a6b7)
Related: #200594 #200659
What Problem This Solves
Updates that rehearse Doctor on a private copy of your state now copy your cold (archived) session transcripts into that copy. Since #200659, if even one archived transcript file referenced by your database was already gone (deleted by hand, lost in a restore, or a dangling link), the update refused before doing anything, and every later update refused the same way. Separately, on Windows the rehearsal shared the live archive files through hard links, and removing those links on a filesystem without POSIX delete semantics (for example an SMB share) clears the live file's read-only attribute.
User Impact
User impact: one lost archive file no longer blocks every update. The rehearsal mirrors your state as it is: a missing archive stays missing, the snapshot reports a warning that names it, and only a Doctor repair that actually reads that archive fails, exactly as it would on your live state. On Windows the rehearsal never shares an archive file with your live state.
Why This Change Was Made
Evidence
Live update proof on Crabbox AWS Linux. Each lane installed published 2026.11.4, seeded one file-backed cold transcript archive with released 11.4 code (database row
storage=fileconfirmed), then deleted the archive file before updating:9bf980ed4a1)Update state snapshot failed ... ENOENT ... during plugin inventory ... stat .../sessions/cold/<archive>.jsonl.zst; stays on 11.41 referenced cold transcript archive file(s) are missing (first: ...)update.runThe fix package was built from
8deffc38ee1. The final head715db3a63d3only widens the same check to the repo'sisMissingPathError(ENOENT or ENOTDIR) for a dangling link whose target path runs through a regular file.Windows (native, Windows Server 2025, Node 24.22.1): a hard link to a read-only live file, then the rehearsal directory removed with
fs.rm. On local NTFS the live file stays read-only (libuv uses POSIX delete). On an SMB share (\\localhost\C$) the live file becomes writable, because libuv's fallback delete clears the read-only attribute of the shared file. With a private copy, both stay read-only. The Windows proof covers the file-system behavior; a full Windows update lane was not run for this change.Regression tests: on base sources 3 of 6 fail (snapshot refuses a missing archive, inventory refuses, the Windows projection shares the inode). With the fix 7 of 7 pass, including a new dangling-link case.
pnpm tsgo:coreandpnpm tsgo:core:testpass.Reviews: autoreview scoped-clean (P2) on
715db3a63d3; independent Codex review: no findings. Earlier rounds found the dangling-link and Windows test-assertion gaps, both fixed.Production LOC: +66/−26 across the worker and its caller (net state.ts 0; tests +114/−39; docs +7/−3).