Repository navigation
fix(update): say a missed original capture does not require a restart - #170380
Conversation
Best-effort original-state capture continued after the inspection text told the operator to retry the update. The continuation warning now says the update proceeds without that capture. Refs: openclaw#170332
|
Codex review: needs maintainer review before merge. What this changesThis PR clarifies best-effort capture warnings and exposes accurate inspection phases, source paths, and fixed SQLite failure causes. Example: An active Gateway changes openclaw.sqlite during an update's original-state capture.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes misleading update guidance that remains on main, follows the recorded maintainer direction, and has no identified introduced defect. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe installed updater attempts an original-state capture before initialization; isolated database workers return inspection results or diagnostics, which the CLI presents and records while preserving existing best-effort continuation. flowchart TD
A[Installed update CLI] --> B[Original capture owner]
B --> C[Isolated database workers]
C --> D[Inspection diagnostics]
D --> E[Warning and update ledger]
E --> F[Continue update]
F --> G[Stopped Gateway migration snapshots]
Technical reviewBest possible solution: Land the producer-level diagnostic repair while preserving best-effort capture and the existing stopped-Gateway recovery boundary. Do we have a high-confidence way to reproduce the issue? Current-main source shows capture errors becoming warnings followed by continued execution while shared diagnostics advise retrying; the report supplies matching released-beta output, and this review executed no target code. Is this the best way to solve the issue? The patch changes guidance at its producer, preserves retry advice for stopping callers, and retains the existing capture and recovery owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9ed9c2cd1744. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +34, Tests +122, Docs +6. Total +162 across 11 files. Added test files: 0. View PR surface stats
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 (9 earlier review cycles; latest 8 shown)
Reviewed October 14, 2026, 8:36 AM ET / 12:36 UTC (Revision 10). |
A capture rejection has to print the continuation warning and still finish the already-current run. The inspection's retry sentence is closed before that warning is appended. The shared diagnostic is unchanged. Refs: openclaw#170332
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Label isolated database generation verification by its own phase and actual source paths, promote fixed SQLite concurrent-write causes to the public summary, and drop retry guidance from best-effort capture failures. The update warning now says it continues without the original-state capture and that pre-migration snapshots remain the database rollback point. Fixes openclaw#170332
|
🦞👀 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. |
|
An installed-driver run with a live writer failed original capture on WAL commit publication verification, which the public summary still masked as [redacted-diagnostic]. Allow both fixed WAL-commit causes from the generation check.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…gnostics An installed-driver run whose own managed Gateway served agent turns during original capture failed on a WAL snapshot hash mismatch, which the warning still masked as [redacted-diagnostic]. Allow that fixed cause.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…openclaw#170380) * fix(update): say a missed original capture does not require a restart Best-effort original-state capture continued after the inspection text told the operator to retry the update. The continuation warning now says the update proceeds without that capture. Refs: openclaw#170332 * test(update): record a missed original capture through updateCommand A capture rejection has to print the continuation warning and still finish the already-current run. The inspection's retry sentence is closed before that warning is appended. The shared diagnostic is unchanged. Refs: openclaw#170332 * fix(update): report original capture failures accurately Label isolated database generation verification by its own phase and actual source paths, promote fixed SQLite concurrent-write causes to the public summary, and drop retry guidance from best-effort capture failures. The update warning now says it continues without the original-state capture and that pre-migration snapshots remain the database rollback point. Fixes openclaw#170332 * fix(update): keep WAL commit causes in public capture diagnostics An installed-driver run with a live writer failed original capture on WAL commit publication verification, which the public summary still masked as [redacted-diagnostic]. Allow both fixed WAL-commit causes from the generation check. * fix(update): keep snapshot hash mismatch causes in public capture diagnostics An installed-driver run whose own managed Gateway served agent turns during original capture failed on a WAL snapshot hash mismatch, which the warning still masked as [redacted-diagnostic]. Allow that fixed cause. --------- Co-authored-by: Dallin Romney <[email protected]>
…openclaw#170380) * fix(update): say a missed original capture does not require a restart Best-effort original-state capture continued after the inspection text told the operator to retry the update. The continuation warning now says the update proceeds without that capture. Refs: openclaw#170332 * test(update): record a missed original capture through updateCommand A capture rejection has to print the continuation warning and still finish the already-current run. The inspection's retry sentence is closed before that warning is appended. The shared diagnostic is unchanged. Refs: openclaw#170332 * fix(update): report original capture failures accurately Label isolated database generation verification by its own phase and actual source paths, promote fixed SQLite concurrent-write causes to the public summary, and drop retry guidance from best-effort capture failures. The update warning now says it continues without the original-state capture and that pre-migration snapshots remain the database rollback point. Fixes openclaw#170332 * fix(update): keep WAL commit causes in public capture diagnostics An installed-driver run with a live writer failed original capture on WAL commit publication verification, which the public summary still masked as [redacted-diagnostic]. Allow both fixed WAL-commit causes from the generation check. * fix(update): keep snapshot hash mismatch causes in public capture diagnostics An installed-driver run whose own managed Gateway served agent turns during original capture failed on a WAL snapshot hash mismatch, which the warning still masked as [redacted-diagnostic]. Allow that fixed cause. --------- Co-authored-by: Dallin Romney <[email protected]> (cherry picked from commit a647368) Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Fixes:
openclaw updatetells the operator to retry the update when best-effort original-state capture fails, even though the update continues and finishes.User Impact
User impact: the capture warning now says the update continues without the capture and that a completed update does not need to be restarted, so operators are no longer told to rerun a successful update.
Why This Change Was Made
Original-state capture stays one best-effort attempt. The warning no longer tells the operator to retry the update. It says the update continues without this capture, and that a completed update does not need to be restarted because of this warning.
No retry is added. The install is not stopped. The shared inspection diagnostic that ends with "then retry the update." is unchanged. Only this best-effort warning rewrites that trailing sentence, and it closes the sentence before the continuation.
Related #170332
Evidence
Production baseline — October 12 update
Captured from the real npm-global update on October 12, 2026 (Halifax time): Debian 13, Node v24.16.0,
2026.10.5-beta.1 (f283c3c)→2026.10.5-beta.2 (467e83d), usingopenclaw update --channel beta --tag 2026.10.5-beta.2 --yes. The saved terminal capture and read-only update-run record agree that the run finished withphase: finished,status: succeeded. Private paths and capture identifiers are redacted; unrelated logs are omitted.The same real update warned that original-state capture failed while reading the live state database, advised a retry, and then installed and finished:
Selected terminal lines, with unrelated output omitted:
The capture diagnostic reports a generation change after 4.215 seconds. This establishes the contradictory retry advice during an otherwise successful update and preserves the intended best-effort continuation described by the maintainer.
Remaining proof gap: This was the official unpatched beta update. It proves the original warning and successful continuation, but does not show the revised warning from an installed CLI containing this PR. The patched command-boundary proof below remains the after-change evidence.
Installed-driver proof (this PR as the running updater)
Docker (
openclaw-published-driver-update-e2eimage, Linux, Node v24.21.0), synthetic state only. The branch at3551492b0abwas packed and installed withnpm install -gas the driver. Doctor ran, then a managed Gateway was started through the repo's systemd fixture (/readyz200). A synthetic second writer committed net-zero schema transactions tostate/openclaw.sqliteevery 25 ms; it was stopped as soon as the capture warning printed (244 commits). Thenopenclaw update --tag <same build relabeled 2026.10.3>.tgz --yesran from the installed driver.The revised warning leads with continuation guidance, has no retry advice, and names the real phase ("database generation verification") and both source paths. The update finished and the Gateway restarted on the candidate. The warning appears in full (no truncation).
That run exposed one more gap: the public summary still printed
[redacted-diagnostic]because the generation check's WAL-commit causes ("SQLite WAL commit publication could not be verified" and "SQLite WAL commit header is unavailable or changing") weren't on the fixed-cause allowlist.351d54b90d1adds both, with cases indiagnostic-support-redaction.test.ts(59 passed, 1.6s). That commit only changes the allowlist; the Docker run above was against3551492b0ab.Rerun at the current head
351d54b90d1(same harness and concurrent writer; 257 commits, stopped when the warning printed). The public summary now prints the WAL commit cause where it used to print[redacted-diagnostic], and the update still completes:Not this PR: the same run later warned "Automatic database restoration unavailable: databases changed after snapshot capture". That is #170335's false generation change, which #170351 fixes.
Real Gateway writer (head
6a158a8baef)Same Docker harness, with no synthetic writer this time. The managed Gateway served real agent turns against the mock OpenAI provider (
scripts/e2e/mock-openai-server.mjs): oneopenclaw agent --agent main --session-key live-1-Nturn every 2 s, continuing through the whole update, Gateway downtime included. The installed driver is this PR at6a158a8baef; the candidate is the same build relabeled 2026.10.3.The Gateway's own writes are enough to trigger the warning, which is the reporter's case. Across three real-Gateway runs at this head and the previous one, the capture failed in a different way each time:
generation changed after its snapshot(above);SQLite WAL commit publication could not be verified(two loops, one turn per second);SQLite snapshot hash mismatchonopenclaw-agent.sqlite-wal(four continuous loops).The last cause still printed as
[redacted-diagnostic]at351d54b90d1.6a158a8baefadds it to the fixed-cause allowlist, with a case indiagnostic-support-redaction.test.ts(60 passed, 7.1 s). The hash mismatch run happened before that commit, so it isn't reproduced at the new head; the unit case covers it.Not this PR: with four back-to-back turn loops (473 turns), candidate admission refused the update. Its error was "could not inspect agent database …: SQLite source did not stabilize after 10 read-only inspection attempts (the database may be under concurrent write activity)". The previous Gateway kept serving (
/readyz200), and all 473 sessions were intact afterward. That is the existing admission retry budget, which is outside this warning-text change, so it goes on the follow-up list.Proof
No live Gateway update was rerun.
updateCommand({ yes: true, json: true, restart: false })ran withcaptureUpdateRecoveryBaselinerejecting the generation-changed inspection error. The command resolved. The visible warning and the completed ledger stepwarning:original-state-capture:were:The admitted run finished
phase: finished,status: skipped,reason: already-current.Base / head
The same boundary test against the parent initializer, which warns with the raw inspection error, failed (exit 1). That run printed:
Head of the same test passed (exit 0) and printed the continuation warning above.
Test
update-command-fresh-preview.test.ts— "continues a completed update when original-state capture fails". The helper-only wording test is removed. The boundary test requires the continuation sentence in both the visible warning and the ledger step, rejects "retry the update", and requires the run to finish already-current.Maintainer update (fix at the producer)
Pushed on top of this branch (merged current
main, no history rewrite):fix(update): report original capture failures accurately. It replaces the post-hoc regex rewrite with a fix where the message is produced, and keeps this PR's "does not need to be restarted" sentence.retryAdviceoption on the inspection diagnostics; restore and Doctor checks keep it).formatBestEffortOriginalCaptureWarningis removed.[redacted-diagnostic]is replaced by the fixed phrase "SQLite file generation changed while reading" (paths stay out of the public summary).docs/cli/update/repair-and-recovery.mdupdated.Evidence: a real
database-generationsworker with a preload writing between its two reads reproduces the issue's message before the change; theupdateCommandtest keeps this PR's name with the new assertions. Focused runs ofupdate-command-fresh-preview,update-candidate-state.schema, anddiagnostic-support-redactionpass (320s).tsgo:core:test, oxlint, oxfmt,git diff --checkclean.Supersedes my duplicate #170396, now closed.