Skip to content

fix(update): derive recovery guidance from the recorded serving verdict - #164193

Merged
steipete merged 1 commit into
mainfrom
upd/upd-recovery-guidance-verified-serving
Oct 3, 2026
Merged

steipete merged 1 commit into
mainfrom
upd/upd-recovery-guidance-verified-serving

Conversation

@steipete

@steipete steipete commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Closes #161924

What Problem This Solves

Fixes contradictory update recovery advice when validation fails before package replacement but the existing Gateway is verified serving: the next action no longer says that it failed verification.

User Impact

Terminal output and the saved Markdown report identify the serving version, say there is nothing to restore, and direct the operator to fix the update failure before retrying openclaw update. The update remains failed. Restart safety, migrated-state restrictions, and genuinely failed verification retain their existing meaning.

This affects updaters that include the fix; candidate code cannot change an older installed updater's already-running report renderer. No new config keys, environment variables, CLI options, dependencies, or schema changes.

Why This Change Was Made

The next-action owner inferred serving failure from unsafe restart authority. It now consumes the same recorded recovery observation and serving-version resolver as the recovery report. The recovery verifier remains the fact producer; neither renderer infers health from the update phase or grants recovery authority.

Thanks @DonnieFi for the detailed reproduction.

Evidence

  • Before the fix, the new regression reproduced verified serving beside did not pass verification; the healthy case failed and the real failed-verification control passed.
  • The regression drives the real recovery verifier, terminal publication, isolated run ledger, and saved Markdown artifact. Only the external readiness observation is mocked; no live operator Gateway or state is used.
  • Four local reporting suites passed three times: 208 tests per pass, with --maxWorkers=1; wall times 102.54 s, 118.74 s, and 37.78 s. The final guidance shard passed 27 tests in 12.69 s (about 4.3 s of test time).
  • All 64 importer files were selected in batches of at most 15: 63 passed; the existing Linux-only update-command-system-service.test.ts suite (6 cases) was skipped on macOS. The batch timeout and solo recheck are documented below.
  • node scripts/check-changed.mjs passed on the final tree (920.02 s), including production types, all 27 core test-type graphs, lint, formatting, and the selected guards.
  • The export-name collision check and restart-swap fixture passed. The three required wrapper/closure suites passed (36 tests; one existing Linux-only case skipped).
  • Required local Codex P1 autoreview: scoped-clean, no actionable P0/P1 findings.
  • Candidate activation: load-induced, passed alone. The Darwin quiescence case timed out at 120,000 ms in an importer batch that took 1,355.23 s. One solo run of src/cli/update-cli.candidate-activation.test.ts passed all 19 tests: 966.72 s wall time, 943.13 s Vitest duration; the previously timed-out case passed in 65.716 s. No timeout or assertion changes.
  • Production LOC: +41/-14; tests: +83/-0; docs: +6/-0.

Slow pre-existing suites (waived)

These suites predate this change and their slow timings are explicitly waived. Times sum Vitest's reported case durations from the local proof runs; the initial candidate-activation total includes the batch timeout documented above.

Suite Reported case time
src/commands/doctor-config-flow.billing-route.test.ts 138.411 s
src/cli/update-cli/update-command-database-rollback.test.ts 226.251 s
src/cli/update-cli.admission-ledger.test.ts 288.427 s
src/cli/update-cli.candidate-activation.test.ts 1,224.399 s
src/cli/update-cli.package-lifecycle.test.ts 953.933 s
src/cli/update-cli/update-command-rollback.test.ts 189.908 s
src/infra/update-candidate-canary.test.ts 56.024 s; longest case 34.363 s
test/scripts/pr-worktree-provision.test.ts 359.864 s; longest case 115.394 s

Use the recorded recovery observation for terminal and durable next-action guidance. Preserve failed update outcomes, unsafe restart status, and migrated-state constraints.
@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: S labels Oct 3, 2026
@steipete
steipete marked this pull request as ready for review October 3, 2026 08:53
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 3, 2026
@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 3, 2026, 5:04 AM ET / 09:04 UTC (Revision 2).

ClawSweeper review

What this changes

The PR makes failed-update guidance in terminal output and saved reports use the recorded serving verdict while preserving restart and rollback restrictions.

Merge readiness

✅ Ready for maintainer review

The fix remains useful: fetched main still contains the contradictory recovery advice. No actionable correctness or security defect was found, and the previous review recorded no findings.

Priority: P2
Reviewed head: ac269e5424c3dddccc5600032f1b14a0bfcf3e2c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with shared interpretation, useful positive and negative regression coverage, and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The provided repository state identifies a MEMBER-authored PR, so the ordinary external-contributor proof gate does not apply. The inspected regression exercises verification, terminal publication, ledger persistence, and Markdown output with mocked readiness; no live execution is claimed. Existing stored formats and migration behavior are unchanged.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The provided repository state identifies a MEMBER-authored PR, so the ordinary external-contributor proof gate does not apply. The inspected regression exercises verification, terminal publication, ledger persistence, and Markdown output with mocked readiness; no live execution is claimed. Existing stored formats and migration behavior are unchanged.
Evidence reviewed 7 items Verified introduced patch: The pinned merge-base-to-head diff changes recovery reporting, its regression coverage, and documentation. The verified test merge has the recorded base followed by the exact PR head as parents and retains the same five-path change.
Current main still needs the repair: Fetched main selects 'did not pass verification' from unsafe restart status and a running service without consulting the successful recovery observation.
One serving-verdict resolver: The extracted resolver preserves the report's existing successful-observation predicate, including exit-code and failure-fact checks. Next-action publication now consumes that same resolver.
Findings None None.
Security None None.

How this fits together

The updater records Gateway readiness and recovery constraints after an update attempt. Its reporting subsystem turns those facts into terminal output, saved reports, and operator guidance.

flowchart TD
  A[Failed update] --> B[Recovery verifier]
  B --> C[Recorded serving observation]
  D[Restart and rollback constraints] --> E[Recovery guidance]
  C --> E
  E --> F[Terminal output]
  E --> G[Saved report]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +27, Tests +83, Docs +6. Total +116 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 41 14 +27
Tests 1 83 0 +83
Docs 1 6 0 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 130 14 +116

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #161924
Summary: This PR directly addresses the canonical report's contradictory serving guidance.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep serving observations and recovery authority separate, with one shared verdict resolver supplying consistent operator guidance.

Do we have a high-confidence way to reproduce the issue?

Yes from source: fetched main can pair successful recovery verification with failure wording derived from unsafe restart status. This review did not execute a current-main reproduction.

Is this the best way to solve the issue?

Yes. Reusing the report's existing serving predicate is a narrow repair that avoids competing health interpretations and preserves recovery constraints.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against dd66b6780734.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The fix corrects misleading recovery advice while the reported Gateway continues serving and the update correctly remains failed.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The provided repository state identifies a MEMBER-authored PR, so the ordinary external-contributor proof gate does not apply. The inspected regression exercises verification, terminal publication, ledger persistence, and Markdown output with mocked readiness; no live execution is claimed. Existing stored formats and migration behavior are unchanged.

Evidence

What I checked:

  • Verified introduced patch: The pinned merge-base-to-head diff changes recovery reporting, its regression coverage, and documentation. The verified test merge has the recorded base followed by the exact PR head as parents and retains the same five-path change. (ac269e5424c3)
  • Current main still needs the repair: Fetched main selects 'did not pass verification' from unsafe restart status and a running service without consulting the successful recovery observation. (src/cli/update-cli/update-recovery-guidance.ts:109, dd66b6780734)
  • One serving-verdict resolver: The extracted resolver preserves the report's existing successful-observation predicate, including exit-code and failure-fact checks. Next-action publication now consumes that same resolver. (src/infra/update-run-report.ts:113, ac269e5424c3)
  • Recovery authority remains separate: The recovery producer explicitly preserves an unsafe restart verdict despite successful serving verification. The patch changes reporting consumers rather than restart, rollback, or authorization decisions. (src/cli/update-cli/update-command-failure-recovery.ts:161, ac269e5424c3)
  • Meaningful regression boundary: The added healthy/failed-readiness cases call the production verifier and terminal publisher, then inspect the real isolated ledger and saved Markdown artifact. Readiness is mocked, so this is supplemental regression evidence rather than a live Gateway run. The body reports baseline failure and after-fix passing runs; no tests were executed during this read-only review. (src/cli/update-cli/update-recovery-guidance.test.ts:89, ac269e5424c3)
  • Distinct reported defect and candidate fix: [Bug]: Update recovery says healthy serving Gateway did not pass verification #161924 supplies a sanitized real 2026.9.6 failure showing verified serving beside contradictory guidance. This PR explicitly closes that issue and remains open and unmerged. Its body correctly explains that candidate code cannot repair an older installed updater's already-running renderer. (ac269e5424c3)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-03T08:58:38.750Z sha ac269e5 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 48ff3d1 into main Oct 3, 2026
198 of 199 checks passed
@steipete
steipete deleted the upd/upd-recovery-guidance-verified-serving branch October 3, 2026 10:04
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
…ct (openclaw#164193)

After a validation failure before package replacement the updater verified the existing Gateway as serving but its next-action text (terminal and Markdown report) said the Gateway did not pass verification: the guidance owner confused unsafe-restart authority with failed serving verification. Guidance now reads the recovery report's recorded serving verdict; failed-update status and restart/migration restrictions are unchanged. Closes openclaw#161924. Thanks @DonnieFi for the report.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Update recovery says healthy serving Gateway did not pass verification

1 participant