Skip to content

fix(update): preserve operator stops and failed repair outcomes - #193885

Merged
RomneyDa merged 2 commits into
mainfrom
openclaw/main-recovery-followup
Nov 10, 2026
Merged

RomneyDa merged 2 commits into
mainfrom
openclaw/main-recovery-followup

Conversation

@tideclaw-bot

@tideclaw-bot tideclaw-bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #188303.

What Problem This Solves

Fixes three recovery defects exposed while validating release backports: restarting a later operator-stopped Gateway, failing completed repair when service ownership is unavailable, and losing the terminal failure record after schema-changing repair fails.

User Impact

Interrupted recovery preserves later operator stops. An unowned service stays stopped with manual-start guidance, and failed post-core repair records failure using the verified installed runtime. Existing data-risk, custody, identity, and live-authority checks remain in place.

Why This Change Was Made

Check durable stop intent before recovery and immediately before native startup, including launchd retries. Use the existing manual-warning path for nonowned verdicts. Select the verified candidate terminal writer at finalize entry, retaining staged fallback before verification. Main’s plugin-cohort handling is unchanged; no production schema change is included.

Evidence

Base: 85c39026a90f58164595249f69c311ed71b44df8; reviewed head: 29250b1840baa1ed26772df373273a2adad71135.

  • All five added regression cases fail on original main and pass with the fix: both ownership verdicts, superseded stop intent before recovery and during inspection, and failed terminal settlement after synthetic schema incompatibility.
  • A mutation removing only the early stop check fails the early-guard test despite retaining the final startup guard.
  • 16 interrupted-helper, 23 repair-service, and 43 native-lifecycle sibling tests pass; final five-case rerun passes.
  • Core, CLI-update and infra-test typechecks; targeted lint, format, test-line ratchet, and diff checks pass.
  • Fresh independent review and canonical autoreview via authenticated OpenClaw engine (P0–P2), covering the full base-to-head change, found no actionable findings.

Draft / remaining gates: real detached processes and ledger operations are exercised, but native managers and schema incompatibility are emulated. Native macOS and packaged actual-candidate/real-agent upgrade proof remain unavailable; CI and enforced reviews remain pending. This does not close #188303 or address the separate #191847 SQLite OOM report.

Worked on by

tideclaw-bot and others added 2 commits November 6, 2026 01:45
Honor durable Gateway stop intent before interrupted recovery and native start. Keep completed repair successful when service ownership is unavailable, and use the verified installed terminal writer before schema-changing finalization.

Co-authored-by: RomneyDa <[email protected]>
Worked on by:
- @RomneyDa

Co-authored-by: RomneyDa <[email protected]>
OpenClaw-Publication: 8df77e59-1294-41e0-bba9-e7d89c74f14e
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: S labels Nov 6, 2026
@clawsweeper

clawsweeper Bot commented Nov 6, 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.

@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. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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 Nov 6, 2026
@clawsweeper

clawsweeper Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR preserves later operator stops, reports completed repairs with unowned services as warnings, and records failed finalization through the verified installed runtime.

Example: An interrupted update records a later Gateway start, followed by an operator stop, before recovery inspects systemd.

  • Before: The helper can restart the Gateway despite the superseded stop intent.
  • After: The helper detects the superseded intent and leaves the Gateway stopped.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused patch has no identified code defect and meaningful regression coverage, but required shipped-behavior and upgrade evidence remains unproven.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: Recovery can undo a later operator stop, misreport completed maintenance as failed, or lose the final failure record after migration.
Reason: These are concrete failures of the existing recovery contract, and maintainer authorship establishes direction; the broader linked incident remains open.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this maintainer-authored PR addresses concrete recovery defects still present on main, and review found no actionable code defect.

Priority: P2
Reviewed head: 9b66f34150ff2927b894e412e885ef93c96d63d4

Before merge

  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

None.

Tests

  • Missing end-to-end proof: Provide redacted packaged-upgrade and native recovery output covering preserved operator stops, warning-only unowned-service repair, and terminal failure recording after a real schema-changing finalization failure, with existing settings and data intact.
Agent review details

How this fits together

The detached update helper and repair CLI consume update history, installation identity, and service ownership to decide recovery, invoke the native service manager, and record the terminal update outcome.

flowchart TD
  A[Interrupted updater] --> B[Detached recovery helper]
  C[Update history and stop intent] --> B
  B --> D[Verified installed finalizer]
  B --> E[Native service manager]
  D --> F[Terminal update record]
  E --> G[Gateway readiness verification]
Loading

Technical review

Best possible solution:

Keep the focused corrections in the existing recovery owners so stop intent, repair warnings, and terminal outcomes follow one authoritative path.

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

Current-main source exposes all three failure paths, and the supplied regression cases target them directly; no target code was executed during this review.

Is this the best way to solve the issue?

The patch is a small complete correction for its stated defects: reuse the stop-history owner at recovery and startup, return the existing manual-warning result, and select the verified writer before finalization can migrate state.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Interrupted recovery, stop intent, repair ownership warnings, and terminal writer selection keeps the original intent (29503e1: Recover killed managed updaters using update-owned stop evidence, preserve operator stops and safety refusals, and use the installed runtime after state migration.)
  • Launchd recovery inspection and native restoration keeps the original intent (1034356: Share the authoritative launchd parser and refuse ambiguous or foreign service identity; the recovery-source extraction preserved existing behavior.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 29503e1 adds src/infra/update-managed-service-handoff-result-source.ts:221 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 29503e14a2d3; files: src/infra/update-managed-service-handoff-result-source.ts)
  • Vincent Koc: Raw commit 1034356 adds src/infra/update-managed-service-handoff-recovery-source.ts:2 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 103435694bef; files: src/infra/update-managed-service-handoff-recovery-source.ts)

PR surface

Source +10, Tests +159, Docs +6, Other +2. Total +177 across 12 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 17 7 +10
Tests 7 160 1 +159
Docs 1 6 0 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 12 185 8 +177

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: The changes repair bounded interrupted-update and explicit-repair failures without establishing an urgent new release regression.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.

Label justifications:

  • P2: The changes repair bounded interrupted-update and explicit-repair failures without establishing an urgent new release regression.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Supply the packaged native-recovery and upgrade evidence identified in the proof assessment.

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.

Reviewed November 5, 2026, 9:07 PM ET / November 6, 2026, 02:07 UTC.

@RomneyDa
RomneyDa marked this pull request as ready for review November 10, 2026 04:11
@RomneyDa
RomneyDa merged commit 21f17af into main Nov 10, 2026
222 checks passed
@RomneyDa
RomneyDa deleted the openclaw/main-recovery-followup branch November 10, 2026 05:16
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 11, 2026
…claw#193885)

* fix(update): preserve interrupted recovery intent and outcomes

Honor durable Gateway stop intent before interrupted recovery and native start. Keep completed repair successful when service ownership is unavailable, and use the verified installed terminal writer before schema-changing finalization.

Co-authored-by: RomneyDa <[email protected]>

* fix(update): preserve operator stops and failed repair outcomes

Worked on by:
- @RomneyDa

Co-authored-by: RomneyDa <[email protected]>
OpenClaw-Publication: 8df77e59-1294-41e0-bba9-e7d89c74f14e

---------

Co-authored-by: RomneyDa <[email protected]>
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: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS launchd: managed Gateway disappears from launchd domain after auto-update (2026.10.8 -> 2026.10.9)

2 participants