Repository navigation
fix(update): unsealed original capture warning names the affected database - #169282
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: needs real behavior proof before merge. What this changesThis PR adds database names, verification categories, and relevant backup warnings to unsealed original-state capture diagnostics. Example: The Gateway writes to /home/alex/.openclaw/state/openclaw.sqlite after its original snapshot.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this PR repairs a confirmed diagnostic gap still present on current main, preserves capture safeguards, and has maintainer engagement; no introduced correctness defect was found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe installed updater's capture owner consumes database snapshots and generation observations, then either publishes a sealed recovery manifest or retains incomplete payloads and sends a warning through the existing CLI diagnostic consumer. flowchart TD
A[Installed updater] --> B[Original capture owner]
B --> C[Database backup owner]
C --> D[Snapshots and generation observations]
D --> B
B --> E[Sealed manifest or retained payloads]
B --> F[Redacted CLI warning]
Technical reviewBest possible solution: Keep the diagnostic repair in the existing capture owner while preserving sealing checks, incomplete evidence, and best-effort update continuation. Do we have a high-confidence way to reproduce the issue? Current-main source shows database-specific backup warnings are lost when sealing throws the generic exception; the linked report observes that warning on an official beta, and no target code was executed during this review. Is this the best way to solve the issue? Changing the exception at the capture owner addresses the established diagnostic loss without weakening generation checks or inventing another recovery path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d178bb8fdd1e. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +7, Tests +39, Docs +3. Total +49 across 3 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 (3 earlier review cycles)Reviewed October 11, 2026, 10:07 PM ET / October 12, 2026, 02:07 UTC (Revision 4). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…abase (openclaw#169282) * docs: plan actionable update capture failure diagnostics * fix(update): name databases that leave the original capture unsealed Closes openclaw#169259
Closes #169259
What Problem This Solves
Fixes: when an update's original-state capture cannot seal, the warning says only "Original database generation changed or could not be verified; capture is unsealed." It does not say which database failed or why.
User Impact
User impact: the existing
Original state capture is unavailablewarning now names each affected database, says whether it changed after its snapshot or never had a stable generation, and includes the backup step's own warning for that database (for example the SQLite error). Sealing safeguards, retained incomplete evidence, and best-effort update continuation are unchanged.Update behavior: this code runs in the updater (driver) process, so the clearer warning appears once the installed updater contains it. Updates driven by 2026.10.5-beta.1 or earlier keep the old wording. No config, schema, or state changes.
Why This Change Was Made
The backup owner already records database-specific reasons, but the capture owner threw one combined error and returned those reasons only after a successful seal. The capture owner now builds one line per unverified database and appends only the backup warnings that mention those databases, inside the same exception the CLI already redacts (state dir and home) and caps at 1,000 characters. Per-database lines come first so they survive truncation.
A database generation is a hash of the file, so any write by the running Gateway during capture (a cron tick, for example) legitimately unseals it. That is documented active-writer behavior; this PR does not change it. The recovery docs now say what the warning contains.
Evidence
src/infra/update-database-backup.test.tsdrives the real capture boundary with real SQLite:manifest.jsonis published and payloads are retained.update-recovery-baseline-capture.ts.node scripts/run-vitest.mjs src/infra/update-database-backup.test.ts --maxWorkers=1took 89 s wall on a heavily loaded host. The new test takes about 3.8 to 4.9 s, the same as its existing sibling, because it runs a real capture; no cheaper layer covers the no-manifest and payload-retention boundary.pnpm tsgo:coreand theinfracore-test typecheck graph pass.node scripts/check-changed.mjs: all ratchets, core typecheck, and 25 core test graphs passed before my local timeout stopped the last three UI graphs, which this change cannot affect.Gaps:
Maintainer verification
Re-verified at head
93eacaf4d36againstorigin/main112c4900cf3(merge-tree clean; main still emits the old bare warning, as doesrelease/2026.10.5):pnpm test src/infra/update-database-backup.test.ts --maxWorkers=1: 20/20 passed, 82 s wall (71 s Vitest) on a loaded host.src/infra/update-recovery-baseline-capture.tsrestored to the merge base, both changed tests fail (-t "unsealed capture|names the database": 2 failed).oxfmt --checkandoxlinton the touched files: clean.Remaining gap, accepted for this diagnostic-only change: no installed published-driver × candidate update cell. The change only alters the text of an existing best-effort warning raised by the updater process; sealing conditions, retained evidence, and update continuation are unchanged and covered by the real-SQLite capture tests above.
Post-merge real update proof: updater with this fix × candidate, and published updater × candidate
Added after merge by the author. It fills the published-driver × candidate gap noted above; no code changed.
This fix runs in the updater, so the "after" run installs this branch's package as the updater. I ran the repository's published-driver Docker cell (
scripts/e2e/published-driver-update-docker.sh) locally, using a local copy of its harness with three changes. The copy can install the updater from a tgz, relabel the candidate to a higher version (2026.10.1), and run a side process during the update. The side process creates a session and callschat.injectthrough the serving Gateway about once a second for the first 90 s. That covers the original-state capture with real Gateway writes, the active-writer case from the docs. Everything else is the stock cell: managed Gateway through the systemd shim, synthetic durable and incognito sessions,openclaw update --tag <candidate.tgz> --yes --json, then run-record, readyz, version, and session checks.The candidate in both runs is this branch (
93eacaf4d36).Before, with the published 2026.10.1 updater (stderr of
openclaw update):The published updater named no database, and this warning did not appear in the recorded run's steps.
After, with this branch as the updater (recorded run step
warning:original-state-capture:1):Both runs: 82 to 90 successful
chat.injectcalls during the window, then the update continued tostatus: "ok". The recorded run isfinished/succeeded, readyz returns 200, the running version is verified, the managed service PID was replaced, durable session history is intact, incognito content is gone, and the seeded credentials sidecar is byte-identical. The incomplete capture was retained at the named path, as before.("published 2026.9.9" is the cell's label for the updater version; that updater is this branch's package.)