Skip to content

fix(update): avoid stop advice after preactivation failure - #177129

Merged
vincentkoc merged 3 commits into
mainfrom
fix-update-recovery-guidance-20261019
Oct 19, 2026
Merged

vincentkoc merged 3 commits into
mainfrom
fix-update-recovery-guidance-20261019

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes misleading stop-and-repair advice when a Git update fails before activation and the existing Gateway remains healthy.

User Impact

Operators get the actual failure and retry command while their unchanged Gateway keeps serving. Recovery that intentionally retains an installed runtime still explains how to finish maintenance, using the selected profile and preserving any recorded rollback refusal or failure.

Why This Change Was Made

A healthy service does not prove the candidate was activated or state was migrated. Record successful installed-runtime recovery admission at its owner, and require that fact before offering maintenance advice. The message describes the installed Gateway and retained state without inventing migration or rollback refusal.

No schema, restart, rollback, or migration behavior changes. Production delta: +19/-3; the added lines record the authoritative recovery-admission fact and retain actual rollback-outcome detail.

Evidence

  • Independent owner-boundary review and scoped autoreview found no actionable findings. The corrected-head ClawSweeper review also cleared both earlier findings and reported no remaining pre-merge actions.
  • Formatting, diff checks, privacy scans, and conservative line-cap checks pass. The normal commit hook completed privacy scans and formatting but could not load the code-only checkout's missing TypeScript tooling; the documented commit exception was used after equivalent checks.
  • The original-order regression covers real Git pack-capacity refusal, installed-runtime verification, terminal publication, SQLite ledger, and report rendering; it asserts no restart or checkout/runtime mutation.
  • CI at fc33aad8 caught two corrections: retain actual rollback-refusal detail, and create canonical profile paths before the recovery run. Both are fixed in 0cea146e6f6.
  • Exact-head CI run 39224130911, attempt 1: guidance 30/30, database rollback 13/13, post-update repair 43/43 — 86 tests passed. Logs confirm the original-order capacity regression, both later-write refusal cases, and all 15 ownership/profile/migration/current-core matrix cases. Types, lint, line-cap, PostgreSQL conformance, and all required CI gates passed.
  • Real recovery coverage includes current-core, migration-required, already-verified migration, and rollback/refusal paths. The outcome table distinguishes not-needed, not-attempted, succeeded, and failed rollback.
  • The old-code negative control remains unexecuted: the configured Testbox allocation queued and was stopped. PR CI is the proof route. No live deployment claim.

@vincentkoc vincentkoc self-assigned this Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 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 cli CLI command changes size: S labels Oct 19, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review October 19, 2026 08:21
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 19, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR requires recorded installed-runtime recovery admission before recommending Gateway stop-and-repair maintenance.

Example: A Git update fails with snapshot-capacity-insufficient while Gateway 2026.7.1 remains healthy under profile work.

  • Before: The updater describes migrated candidate state and recommends stopping the Gateway for repair.
  • After: The updater says Gateway 2026.7.1 is still serving and recommends resolving the capacity failure before retrying openclaw --profile work update.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, useful correction with both earlier findings resolved and successful focused CI; confidence is bounded by harness-based evidence and the unexecuted negative control.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; supplied validation exercises recovery owners and report persistence in-process with mocked health and service boundaries, without claiming a live CLI update.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An update that leaves the existing Gateway healthy can incorrectly tell its operator to stop it and repair migrated state.
Reason: Accurate recovery advice avoids unnecessary interruption, and the maintainer-authored direction preserves existing safety and maintenance contracts.

Merge readiness

✅ Ready for maintainer review

Both earlier findings are resolved, and this PR fixes misleading recovery advice still present on current main; no remaining actionable defect was found.

Priority: P2
Reviewed head: 0cea146e6f69850c77af5d9d9a25049b5d515500

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No shipped-CLI capture demonstrates the changed advice, and red-on-base execution of the new regression remains unexecuted.
Agent review details

How this fits together

The update CLI combines recovery-owner decisions and Gateway verification results into persisted next-action guidance shown in terminal output and update reports.

flowchart TD
  A[Update failure] --> B[Recovery admission owner]
  B --> C[Recorded recovery facts]
  A --> D[Gateway verification]
  C --> E[Next action selection]
  D --> E
  E --> F[Ledger and user report]
Loading

Technical review

Best possible solution:

Keep recovery admission authoritative and use its recorded outcome to distinguish unfinished maintenance from an untouched healthy Gateway.

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

Source tracing shows that healthy preactivation recovery reaches the same main-branch guidance as admitted forward recovery; the added regression composes Git admission, verification, publication, SQLite history, and rendering with mocked health observations.

Is this the best way to solve the issue?

The patch is a focused repair: the existing recovery owner records admission, and the existing guidance owner consumes it without adding another lifecycle path.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Healthy installed-runtime guidance changes intended behavior with a stated reason (8f364a7: Settled Doctor recovery needed maintenance guidance while preserving migrated state; subsequent recovery work broadened the condition and retained stop-first maintenance advice.)
  • Recorded rollback detail keeps the original intent (73bb905: Recovery guidance retained the rollback refusal while allowing a healthy recovered Gateway to serve.)
  • Recovery fixture and reporting coverage keeps the original intent (01430fa: Post-update failure reporting needed to observe actual Gateway recovery instead of treating unavailable verification as proof of outage.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit 931de9e adds src/cli/update-cli/update-command-post-update-repair.test.ts:69 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 931de9e55a35; files: src/cli/update-cli/update-command-post-update-repair.test.ts)

PR surface

Source +16, Tests +120. Total +136 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 19 3 +16
Tests 4 149 29 +120
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 168 32 +136

Review metrics

Metric Value Why it matters
Production versus test changes Production +19/-3; tests and support +149/-29 The small production change records admission and selects accurate guidance; test growth covers the capacity-refusal path, rollback outcomes, and canonical profile recovery.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Incorrect advice can cause unnecessary Gateway downtime after an advanced Git-update failure, while the existing Gateway remains usable.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-19T08:36:34.299Z sha fc33aad :: needs changes before merge. :: [P2] Build a canonical work-profile fixture before recovery | [P2] Preserve the recorded rollback-refusal reason in recovery advice

Reviewed October 19, 2026, 4:53 AM ET / 08:53 UTC (Revision 2).

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review corrected head 0cea146e6f69850c77af5d9d9a25049b5d515500. Both findings on fc33aad8 are fixed: the profile fixture now derives canonical paths before run/service setup, and recovery advice preserves actual not-attempted/failed rollback details without inventing a refusal for not-needed/succeeded outcomes.

Exact-head CI run 39224130911, attempt 1, has passed all three focused suites: guidance 30/30, database rollback 13/13, post-update repair 43/43. The old-code negative control remains unexecuted; broad CI is still running.

@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 19, 2026
@clawsweeper clawsweeper Bot removed clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 19, 2026
@vincentkoc
vincentkoc enabled auto-merge (squash) October 19, 2026 08:56
@vincentkoc
vincentkoc merged commit 7bfea50 into main Oct 19, 2026
161 checks passed
@vincentkoc
vincentkoc deleted the fix-update-recovery-guidance-20261019 branch October 19, 2026 09:04
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
…177129)

* fix(update): avoid stop advice after preactivation failure

* fix(update): retain rollback detail in recovery guidance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M 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.

1 participant