Skip to content

fix: let the next update finish a killed update that had already installed the new version - #200866

Merged
fuller-stack-dev merged 5 commits into
openclaw:mainfrom
fuller-stack-dev:fix/update-finishes-killed-installed-update
Nov 18, 2026
Merged

fuller-stack-dev merged 5 commits into
openclaw:mainfrom
fuller-stack-dev:fix/update-finishes-killed-installed-update

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

When an openclaw update is killed partway through, the next openclaw update sometimes refuses and tells you to run openclaw update repair first, even though nothing about the leftover state needs a person's judgment. Three common leftovers hit this:

  • the killed update had replaced the installed version and was not confirmed finished;
  • it had begun rolling its plugin changes back on the version it installed;
  • it had stopped the Gateway and never started it again.

User Impact

User impact: in those three cases a plain openclaw update now finishes the killed update the way openclaw update repair does, then carries on, with no second command needed. When finishing fails, or the case needs a person (for example --no-restart with a stopped Gateway), it still stops and names openclaw update repair.

openclaw update repair and openclaw update finalize behave exactly as before.

Why This Change Was Made

Approval scope: the repository owner approved splitting the finalize step that openclaw update repair runs (Doctor for the installed version, plugin convergence, Gateway restoration) into a stage that openclaw update can call for a killed update, with the stage printing nothing itself. The coordinator chose option A: the stage keeps repair's own run record. The change is limited to what is recorded and when. There are no schema, ledger, config, protocol or dependency changes, and no lease, fence, authority or integrity check is relaxed.

The stage writes a second run row, and here is why. The stage has to run before the update decides anything about its own version, because its Doctor and plugin convergence rewrite config that the update's target resolution reads. At that point the update's own run does not exist yet: a command-line update creates it only after target resolution. Creating it earlier would mean reordering run admission or changing the ledger, both outside the approval. So the stage records exactly the repair-shaped run that openclaw update repair records for the same state. The update's run then gets an interrupted-update-finalization warning step that names that run.

Design:

  • One owner. update-command-finalize.ts keeps one finalization implementation. updateFinalizeCommand is the command shell: admission reporting, failure triage, the JSON or text result, exit codes including exit 2, and the post-output exit watch. finishInterruptedUpdate runs the same body in stage mode:

    • the same history reconciliation repair does first;
    • its own repair run (attachLedger(repair), exactly as repair);
    • Doctor, plugin convergence, completion cache, Gateway restoration, then acknowledging the killed run.

    In stage mode it skips admission reporting and triage, writes no result document, skips the exit watch, and never calls exitCliAfterOutput. Deferred Doctor maintenance (repair's exit 2), a timeout, or any failure is thrown to the caller instead. The lifecycle's timeout JSON is suppressed for a stage. prepareUpdateFinalization moved unchanged into update-command-finalize-config.ts to keep the module under the max-lines limit.

  • Caller. inspectInterruptedUpdateRecovery keeps every proof from fix: let the next update continue after a killed update when nothing is left to repair #200680 and settles the cohort under the claim it already takes. For states 1 to 3 it no longer refuses. After the claim is released, as in repair, it calls the stage and records two warning steps (settlement and pointer), then the update continues. A stopped Gateway (state 3) is handled only when restart is enabled.

  • Authority re-asserted by the stage:

    • recovery admission at its preflight;
    • Doctor's admission of the recorded update drivers;
    • a new installation claim plus the pending-stop and data-at-risk checks before restoring the Gateway.

    As in repair, Doctor and plugin convergence run without an installation claim.

  • Refusals added so the stage never finishes less than repair would:

    • other update history still owes recovery: another unacknowledged interrupted run, a post-core failure, or an earlier update's pending Gateway stop (repair would finish those too);
    • repair's finish ends with a warning and leaves the stopped Gateway down.

    In each case the update refuses and names repair.

Evidence

Behavior checked, through the real openclaw update command entry with real killed updater child processes (SIGKILLed after reserving their plugin cohort), and the real stage (finalization, ledger, cohort settlement, executor claims, Gateway restoration):

  • States 1, 2, 3 (restart on): the update settles, finishes and continues. Checked:

    • before the update's admitted execution, the installed version's Doctor ran once, the Gateway was started once (state 3 only), and no JSON document was printed;
    • cohort settled, installed version unchanged, config as repair leaves it;
    • one succeeded repair-shaped run, plus the pointer step naming it;
    • killed run retired and acknowledged.
  • Same state, update vs. manual repair: the stage run and repair's run have the same shape (trigger, phase, status, reason, target, after, origin and verification keys, serving flags, step names and statuses). The killed runs match too, and so do the settled config values. Repair printed its one result; the stage printed none.

  • Failure paths:

    • Doctor fails;
    • Doctor maintenance must wait (repair's exit 2);
    • repair's finish leaves the Gateway stopped.

    In each the update stops before admitted execution, names openclaw update repair, prints no JSON, and has no ExitError in its cause chain. The stage run is failed / skipped (doctor-maintenance-pending) / succeeded-with-warning as repair would leave it, and no run is recorded as a successful update.

  • Still refusing, each with the recovery left untouched:

    • live updater;
    • another running update;
    • lease store removed, replaced or retired;
    • managed helper adopted;
    • Gateway-started update;
    • state 3 with --no-restart;
    • unverified candidate whose updater is still alive (state 1 neighbour);
    • rollback begun but adopted by a managed helper (state 2 neighbour);
    • unusable settlement;
    • source checkout;
    • other installation;
    • dry run;
    • earlier update left the Gateway stopped;
    • another unacknowledged interrupted update;
    • installation held by another updater;
    • recovery repair cannot settle;
    • package rollback in progress;
    • journal from another build.

Base reproduction on origin/main (b60b114, through the update command entry): states 1 to 3 each refused with Run openclaw update repair. State 3 refused identically with restart enabled and with --no-restart, on both the candidate and the previous version.

Installed command, real Doctor (Docker lane package-installed-recovery). After each cut's update repair, the lane now updates to a fixture candidate whose post-activation Doctor sends SIGKILL to its updater. The candidate is installed and the run is left running (state 1). A plain openclaw update --tag file:<next> --yes --no-restart --json follows with no repair. From the real state database and output, the lane checks:

  • the update exits 0 and prints one JSON document (status: "ok");
  • the killed run is failed / abandoned and acknowledged;
  • exactly one stage run (finalize:repair-continuation, trigger: cli, succeeded) ran the real pre- and post-plugin Doctor;
  • the update's own run is succeeded, has both new steps, and its warning:interrupted-update-finalization names the killed run and the stage run;
  • nothing is left running, and the next version is installed.

All seven cuts on this Mac under Docker Desktop: six pass. partial-previous passes its harness and then fails the access-reader check, which cannot pass under Docker Desktop on macOS and failed the same way before this change. Raw results are in this comment.

Stored history. Published readers accept the new step names. At v2026.11.5 and v2026.10.10 the stored step name is step: z.string() (src/infra/update-run-schema.ts:188 / :186), decodeRun parses with that schema (src/infra/update-run-read.kernel.ts:30), and the Gateway protocol uses step: text (packages/gateway-protocol/src/schema/update-runs.ts:127). This PR changes no schema, codec or ledger, so older runs decode as before.

Simulated in the process tests, as in the existing repair fixtures: the Doctor child processes, post-plugin convergence, plugin installs, Doctor's own service maintenance, failure triage and the completion cache. The Gateway service is a fixture service whose start and health are observed.

Commands and counts

Base reproduction, base b60b1147460 and 40cd5c14297 (temporary scratch tests, not committed):

  • update vs. repair across 11 states: update refused in all; repair settled where no live or adopted driver.
  • state 3 × restart on / --no-restart × candidate / previous: all four refused with the same text.

Red (new tests, base production code): node scripts/run-vitest.mjs src/cli/update-cli/update-command-killed-run.process.test.ts
→ 10 failed / 19 passed (29) at that point in the branch. The three finish cases, three repair comparisons and two failure-path cases failed because base refuses. The stalled-candidate neighbour failed in its final step: after the updater is killed, base still refuses. The --no-restart control failed on its new wording.

Green, head b73817d8a1b (rebased on 0c19bcdf293, then on dbf626f3ddb; the last range touches only ClawHub plugin reinstall internals that these tests mock, diagnostics liveness, sessions and UI, so the proof was not rerun):

  • killed-run file: 32 passed (32)
  • update-repair-command, update-plugin-cohort-settlement, update-command-finalize-refusal, update-cli.finalizer, update-repair-handoff, update-command-publication-kill.process, update-repair-service, update-repair-cancellation, update-repair-history, update-repair-triage, update-finalization-lifecycle, update-command-legacy-finalize, update-repair-package-activation, test/scripts/update-restart-module-outcome, test/scripts/eager-import-closure: 17 files, 297 passed (shards 23 + 24 + 24 + 190 + 36). No existing assertion in these files changed.
  • pnpm tsgo:all: pass
  • pnpm check:baseline-ratchets --base origin/main --no-merge-base: all 10 ok (net test lines +310, under the 400 allowance)
  • OPENCLAW_CHECK_CHANGED_SKIP_DEADCODE=1 node scripts/check-changed.mjs: pass
  • pnpm check:docs: pass; git diff --check: clean

Installed lane, harness at 391dbbda29a, package built from b73817d8a1b (same product source): OPENCLAW_DOCKER_ALL_FAIL_FAST=0 node scripts/test-docker-all.mjs --lanes=package-installed-recovery → anchor-before, anchor-after, anchor-sync, helper-before, helper-after and helper-sync pass; partial-previous harness PASS, access-reader check fails (Docker Desktop host limit). The same lane before the variant, at b73817d8a1b: the same six pass, partial-previous the same.

Merged head bf5fe92109a (main at 3460f617860; the new range touches state-lease release under contention, sessions, agents, UI and cleanup, not the update command, finalization, cohort settlement or the lane, so the Docker proof was not rerun):

  • killed-run file: 32 passed (32)
  • test/scripts/upgrade-survivor-installed-recovery-diagnostics.test.ts + upgrade-survivor-installed-recovery.test.ts: 47 passed, 1 failed (keeps shared evidence readable through restrictive umask, which also fails on main on this Mac)
  • pnpm check:baseline-ratchets --base origin/main --no-merge-base: all 10 ok (net test lines +324)

Not proven or not run:

  • Gateway. The installed lane has no Gateway service, so state 1 ran with nothing to restore. State 3 (Gateway left stopped, restart on) was not run installed; the process tests cover it with a fixture service.
  • State 2 (rollback begun) was not reached installed; the process tests cover it.
  • Doctor's service maintenance with a running Gateway was not run. Like repair, it may stop and restore a running Gateway even under --no-restart in states 1 and 2.
  • Linux host. The installed proof ran under Docker Desktop on macOS only.
  • Not reproduced: a new updater admitted between the settlement claim's release and the stage. Repair has the same window.
  • Autoreview: the helper does not run on this machine, so it was not used. A fresh independent reviewer read the diff; its findings are addressed above.

…alled the new version

When a killed openclaw update had replaced the installed version without
confirming it, had begun rolling its plugin changes back on it, or had left
the Gateway stopped, the next openclaw update refused and named
openclaw update repair. It now settles the plugin recovery as before and then
runs repair's own finalization (Doctor, plugin convergence, Gateway
restoration) as a stage that records its own repair run, prints no result and
never exits, then continues. A stopped Gateway is finished only when the update
would restart it anyway; --no-restart, other unfinished update history, or a
failed finish still refuse and name openclaw update repair. Repair and
standalone finalize are unchanged.
@clawsweeper

clawsweeper Bot commented Nov 17, 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: L labels Nov 17, 2026
@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. 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. labels Nov 17, 2026
@clawsweeper

clawsweeper Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

The next update finishes eligible killed updates through repair’s finalization before continuing.

Example: An update installed OpenClaw 2026.12.1 and was killed before completing finalization.

  • Before: The next openclaw update refuses and requires openclaw update repair.
  • After: The next update settles recovery, finalizes the installed version, records the repair run, and continues.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused implementation has useful process-harness coverage and no discrete source finding, but does not clear the required behavior and existing-state proof gates.
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: Complete
User problem: Retrying a killed update requires a separate repair command even when the existing repair owner can finish the leftover work automatically.
Reason: The maintainer-authored direction removes a concrete recovery obstacle while retaining explicit repair for cases needing operator action.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep this PR open: current main still refuses these interrupted-update states, and the patch reuses repair’s existing finalization owner without a definite introduced defect.

Priority: P2
Reviewed head: b73817d8a1b01d218536989015e4f59991cd61bb

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: Installed CLI recovery with real Doctor, plugin convergence, Gateway readiness, one final update result, and latest-stable upgrade preservation is not demonstrated.
Agent review details

How this fits together

CLI update preparation examines interrupted plugin recovery before selecting its update target; the shared repair finalizer performs Doctor, plugin convergence, and owned Gateway restoration, returning recorded outcomes to the calling update.

flowchart TD
A[CLI update] --> B[Inspect interrupted recovery]
B --> C[Settle plugin cohort]
C --> D[Shared repair finalization]
D --> E[Doctor and plugin convergence]
E --> F[Gateway restoration]
F --> G[Record repair and continue update]
Loading

Technical review

Best possible solution:

Reuse repair’s finalization before target resolution while preserving its recovery checks and the calling update’s output contract.

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

Current-main source explicitly refuses the reported candidate and rollback states, and the PR reports failing-before/passing-after process tests; this review did not execute them.

Is this the best way to solve the issue?

The defect is that settlement alone cannot finish an interrupted installed candidate; the required invariant is repair-equivalent completion before continuing, and the shared finalization stage is a focused implementation using existing owners.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Interrupted-update settlement eligibility changes intended behavior with a stated reason (23fca1a: Automatic settlement originally excluded states requiring installed-version maintenance because an already-current update would skip that work.)
  • Finalization reporting, deadlines, and recovery keeps the original intent (fix(update): bound finalization and diagnose stalled phases #140648: Finalization needs bounded failures and recorded outcomes while retaining cleanup and Gateway recovery before command exit.)
  • Gateway restoration after interrupted updates keeps the original intent (29503e1: Repair must restore and verify a Gateway stopped by an updater that died.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Jason (Json): Raw commit c718583 adds src/cli/update-cli/update-plugin-cohort-settlement.ts:93 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c7185836beb3; files: src/cli/update-cli/update-plugin-cohort-settlement.ts)
  • Peter Steinberger: Raw commit 29503e1 adds src/cli/update-cli/update-command-finalize.ts:379 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/cli/update-cli/update-command-finalize.ts)

PR surface

Source +176, Tests +312, Docs +24. Total +512 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 395 219 +176
Tests 1 339 27 +312
Docs 3 53 29 +24
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 787 275 +512

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: This removes an avoidable manual repair step after a killed CLI update, with an existing recovery command available.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.

Label justifications:

  • P2: This removes an avoidable manual repair step after a killed CLI update, with an existing recovery command available.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.

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 17, 2026, 7:00 PM ET / November 18, 2026, 00:00 UTC.

Each installed-recovery cut now kills an updater in its post-activation Doctor, after it installed its candidate, and checks that the next plain openclaw update finishes that run as repair does before updating.
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XL and removed size: L labels Nov 18, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Proof for the two open review items

1. Stored update history stays readable both ways

A stored run's step name is a free string, not an enum, in published releases and in this branch.

  • v2026.11.5 (newest stable) and v2026.10.10: src/infra/update-run-schema.ts defines const text = z.string().max(UPDATE_RUN_TEXT_LIMIT) (line 151 / 149) and UpdateRunStepSchema has step: text (line 188 / 186). decodeRun in src/infra/update-run-read.kernel.ts:26-30 parses every stored row with that schema at both tags. The Gateway protocol schema, packages/gateway-protocol/src/schema/update-runs.ts:127, is also step: text at both tags. A published version that reads history written by this branch accepts interrupted-update-finalization and warning:interrupted-update-finalization.
  • This branch: the same step: text at src/infra/update-run-schema.ts:189. The PR does not touch the schema, codec, ledger or protocol, so runs written by older versions decode as before.
  • Every other stored value the stage writes already exists: step status completed, trigger cli, run status succeeded, killed-run status failed with reason abandoned.
  • fix: let the next update continue after a killed update when nothing is left to repair #200680 wrote interrupted-update-recovery the same way, but it is on main only and in no published tag, so it is not shipped precedent.

2. A real installed update, killed after installing, finished by the next plain update

I extended the package-installed-recovery Docker lane (commit 391dbbd). After each cut's existing update repair, the lane now:

  1. Updates to a fixture candidate whose post-activation Doctor sends SIGKILL to the updater that started it. The candidate is installed and the run is still running: state 1. A marker file arms the kill once, so every later Doctor is the real one.
  2. Runs a plain openclaw update --tag file:<next> --yes --no-restart --json. No repair runs first.
  3. Asserts from the real state database and output:
    • the next update exits 0 and stdout is one JSON document with status: "ok";
    • the killed run is failed / abandoned with reconcile:acknowledged;
    • exactly one new run carries finalize:repair-continuation (the stage), trigger: cli, status: succeeded, and it ran the real pre-plugin doctor and post-plugin doctor;
    • the update's own run is succeeded and has interrupted-update-recovery and interrupted-update-finalization, and warning:interrupted-update-finalization names both the killed run and the stage run;
    • no run is left running, and the installed version is the next update's.

The public diagnostics receipt now requires this killedUpdate record, and its unit test covers the receipt with and without it.

Run on this Mac under Docker Desktop, lane harness at 391dbbd, package built from b73817d (the product source is identical; that commit changes only scripts/ and test/scripts/):

cut lane killed updater next plain update
anchor-before pass exit 137 in post-activation Doctor exit 0, stage succeeded, update succeeded
anchor-after pass same same
anchor-sync pass same same
helper-before pass same same
helper-after pass same same
helper-sync pass same same
partial-previous harness PASS, then the access-reader check fails same same

The partial-previous access-reader check cannot pass under Docker Desktop on macOS. It failed the same way on b73817d before this change, where the other six cuts also passed with update repair.

One raw pointer row from anchor-before:

warning:interrupted-update-finalization: Finished interrupted update 32e608a6-f2c6-4026-a862-9c8747f4009f as openclaw update repair does (Doctor, plugin convergence and Gateway restoration); recorded as update run 6aae63ab-8c62-4dd0-8861-97bfd1c39c6e (warning).

The stage's own result is warning (Doctor warnings about retained runtimes in the container), and its run is still recorded succeeded. The update continued, as designed.

Not shown

  • Gateway. This lane installs no Gateway service ("service management skipped: non-default state dir"), so state 1 ran with no Gateway to restore. State 3 (Gateway left stopped, restart on) needs a service manager in the lane and was not run.
  • State 2 (rollback begun) was not reached in Docker.
  • Linux host. Only Docker Desktop on macOS. No Crabbox run.

After the proof I merged current main (3460f61). The new range touches state-lease release under lock contention (#200742), Gateway session lists, agents, UI, and cleanup/uninstall. None of it touches the update command, finalization, cohort settlement, or this lane, so I did not rerun the Docker proof. On the merged head bf5fe92: update-command-killed-run.process.test.ts 32 passed, the two installed-recovery harness test files 47 passed and 1 failed. That failure, keeps shared evidence readable through restrictive umask, also fails on main on this Mac.

@fuller-stack-dev
fuller-stack-dev enabled auto-merge (squash) November 18, 2026 02:33
@fuller-stack-dev
fuller-stack-dev merged commit fdf0c95 into openclaw:main Nov 18, 2026
216 of 218 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the fix/update-finishes-killed-installed-update branch November 18, 2026 03:32
@fuller-stack-dev

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 Nov 18, 2026
…alled the new version (openclaw#200866)

* fix: let the next update finish a killed update that had already installed the new version

When a killed openclaw update had replaced the installed version without
confirming it, had begun rolling its plugin changes back on it, or had left
the Gateway stopped, the next openclaw update refused and named
openclaw update repair. It now settles the plugin recovery as before and then
runs repair's own finalization (Doctor, plugin convergence, Gateway
restoration) as a stage that records its own repair run, prints no result and
never exits, then continues. A stopped Gateway is finished only when the update
would restart it anyway; --no-restart, other unfinished update history, or a
failed finish still refuse and name openclaw update repair. Repair and
standalone finalize are unchanged.

* test(e2e): kill an installed update and let the next update finish it

Each installed-recovery cut now kills an updater in its post-activation Doctor, after it installed its candidate, and checks that the next plain openclaw update finishes that run as repair does before updating.
RomneyDa added a commit that referenced this pull request Nov 18, 2026
* fix(update): include cold archives in candidate snapshots

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

* fix(update): preserve file archives in rehearsal snapshots

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

* fix(update): preserve source WAL state during archive inventory

Classify cold archive SQL under its existing candidate-state subprocess owner. Preserve incomplete WAL source families so header inspection retains private cleanup custody.

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

---------

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

Release adaptation: the baseline does not contain the #195487 header-cleanup
suite. Keep that unrelated suite absent; carry the new incomplete-WAL inventory
assertions into the existing inventory suite instead. Add a per-change 214-line
allocation for the source regression, chunk fallback, and WAL preservation tests.
No schema, updater protocol, authority, or archive-integrity changes.

Companion audit at 9e917f0:
- #200733 is selected as the next dependency-closure repair: missing archives
  must warn instead of blocking updates, and Windows copies must not share live
  read-only inode attributes. Do not qualify this intermediate checkpoint alone.
- #200076 and #200930 are independent cold-history performance changes, not
  prerequisites for this snapshot repair.
- #201009, #200994, #200866, #200577, #200805, #200802, and #200732 overlap only
  adjacent update documentation and independent repair flows; not prerequisites.

Proof on base 309067b:
- New production-subprocess regression: 4/4 fail before, 4/4 pass after.
- Cold archives, chunks, and inventory: 31/31 pass after.
- Additional budget/cleanup/import siblings: 46/47 pass. Configured-cache
  containment fails identically on the unchanged base at budget.test.ts:737;
  retained as an independent failure, not weakened or repaired here.
- Targeted lint and format, documentation links, SQLite worker ratchet, and
  test-line ratchet pass. SQLite T1 counts remain 170; compatibility 15.
- Worker typecheck was blocked at dependency custody, without guard bypass.
  Parent canonical core typecheck, typed lint (five files), and formatting
  passed with its owned dependencies. Full installed-upgrade/FRV proof remains
  pending the assembled candidate, including selected companion #200733.

(cherry picked from commit 802e3f7)

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
@fuller-stack-dev

fuller-stack-dev commented Nov 18, 2026 •

Copy link
Copy Markdown
Member Author

Proof recordings: red on base, green on the merge

Terminal recordings of the reproduction this PR describes, run again after merge on this Mac. Base/red uses the base this PR names for its red run, b60b1147460. Head/green uses the merge commit fdf0c95ad6f. Each video shows its label, the exact SHA, the command, the raw output, the exit code and the final status. Idle gaps are capped at 1 s and playback is sped up 3x; nothing is re-typed.

Full raw logs are not attached yet because the artifact store rejected uploads; the excerpts below are not the complete record.

1. Killed-run process test (real killed updater children, real openclaw update entry)

node scripts/run-vitest.mjs src/cli/update-cli/update-command-killed-run.process.test.ts

  • Base / red: product code at b60b1147460, with this test file copied unchanged from fdf0c95ad6f. Result: 13 failed | 19 passed (32), exit 1. The three finish cases, the three repair comparisons and the three failure-path cases fail because base refuses the next update with has unfinished recovery; reconcile it before starting another update ... Run openclaw update repair to finish it. Four "still refuses" controls fail on the refusal wording this PR changed, or, for the unverified-candidate neighbour, because base still refuses after its updater is killed.
pr200866-process-base-red-b60b1147460.mp4
  • Head / green: fdf0c95ad6f. Result: 32 passed (32), exit 0.
pr200866-process-head-green-fdf0c95ad6f.mp4

2. Docker lane package-installed-recovery (7 cuts)

Local OrbStack (macOS host, Linux containers). The lane was extended in this PR, so red is the merge's harness driving a candidate package built from the base product code. Both sides ran all seven cuts with OPENCLAW_DOCKER_ALL_FAIL_FAST=0; OPENCLAW_DOCKER_ALL_PREFLIGHT_CLEANUP=0 only keeps the runner from removing other stopped containers on a shared Docker host. After the run, each video prints every cut's stored installed-recovery.json, its driver error and the plain update's failure reason.

  • Base / red: harness at fdf0c95ad6f, candidate packed from b60b1147460 (its dist/build-info.json names commit b60b11474606).
    OPENCLAW_DOCKER_ALL_PREFLIGHT_CLEANUP=0 OPENCLAW_DOCKER_ALL_FAIL_FAST=0 OPENCLAW_CURRENT_PACKAGE_TGZ=<base pack> node scripts/test-docker-all.mjs --lanes=package-installed-recovery
    Result: all 7 cuts fail (311 to 354 s each), exit 1. In every cut the updater is killed after installing the candidate, and the plain openclaw update --tag file:<next> --yes --no-restart --json that follows exits 1 (next-update: exit 1) with has unfinished recovery; reconcile it before starting another update. That update replaced OpenClaw 2026.11.5-first-hop.N and was not confirmed finished. Run openclaw update repair to finish it, then retry openclaw update.
pr200866-lane-base-red-b60b1147460.mp4
  • Head / green: fdf0c95ad6f; the runner packs this tree itself.
    OPENCLAW_DOCKER_ALL_PREFLIGHT_CLEANUP=0 OPENCLAW_DOCKER_ALL_FAIL_FAST=0 node scripts/test-docker-all.mjs --lanes=package-installed-recovery
    Result: six cuts pass (473 to 575 s each). In all seven, including partial-previous, the stored evidence is status=passed: the killed updater exited 137, the killed run is failed/abandoned, the plain update returned {"status": "ok"}, and one cli stage run succeeded. partial-previous then fails after its harness PASS, in the access-reader step: docker: Error response from daemon: unable to find user 65534: no matching entries in passwd file (exit 125). That is the known macOS Docker host limit on the access reader, not this change; the lane exits 1 because of it.
pr200866-lane-head-green-fdf0c95ad6f.mp4
Excerpts from these runs
# process test, base/red b60b1147460 (+ head test file)
FAIL ... > finishes a dead update that replaced the installed version unconfir… as repair does, then proceeds
FAIL ... > finishes a dead update that had begun rolling back on the version i… as repair does, then proceeds
FAIL ... > finishes a dead update that left the Gateway stopped as repair does, then proceeds
FAIL ... > records what repair records when the dead update ... (3 cases)
FAIL ... > stops and names repair when finishing fails: Doctor fails on the installed version
FAIL ... > stops and names repair when finishing fails: Doctor maintenance must wait
FAIL ... > stops and names repair when repair's finish leaves that Gateway stopped
FAIL ... > still refuses when ... (4 cases)
Received: "Error: Update <run> has unfinished recovery; reconcile it before starting another update.
  That update replaced OpenClaw 2026.11.3 and was not confirmed finished.
  Run openclaw update repair to finish it, then retry openclaw update."
      Tests  13 failed | 19 passed (32)
[test] failed 1 Vitest shard in 267.88s
[test] FAILED (exit 1)

# process test, head/green fdf0c95ad6f
      Tests  32 passed (32)
[test] passed 1 Vitest shard in 293.76s

# lane, base/red (candidate b60b1147460, harness fdf0c95ad6f), same for all 7 cuts
[installed-recovery] installed-recovery-<id>: killed-update
[installed-recovery] installed-recovery-<id>: next-update
[installed-recovery] FAILED (exit 1)
driver.err: AssertionError [ERR_ASSERTION]: next-update: exit 1
next-update.err: [openclaw] Reason: Update <run> has unfinished recovery; reconcile it before starting
  another update. ... Run openclaw update repair to finish it, then retry openclaw update.
==> exit code: 1  (elapsed 2381s)

# lane, head/green fdf0c95ad6f
==> [package-installed-recovery-helper-sync] pass 563s
==> [package-installed-recovery-anchor-sync] pass 575s
==> [package-installed-recovery-helper-after] pass 513s
==> [package-installed-recovery-anchor-after] pass 541s
==> [package-installed-recovery-helper-before] pass 473s
==> [package-installed-recovery-partial-previous] fail status=125 516s
==> [package-installed-recovery-anchor-before] pass 519s
[<every cut>] status=passed killedExit=137 killed=failed/abandoned nextResult={"status": "ok", "restart": null} stages=[('cli', 'succeeded')]
# partial-previous log:
[installed-recovery] PASS: 1 retirement cuts, missing CLI recovery, and next update
docker: Error response from daemon: unable to find user 65534: no matching entries in passwd file
[upgrade-survivor] FAILED (exit 125)
==> exit code: 1  (elapsed 4136s)
From the original run (not a new run)

Logs kept from the proof runs quoted in the PR body, with paths redacted.

# unit/killedrun-red.log (published sha256 da5ae37b526af3c57fc517e5fb41c7890108f5f98e4cc69e636d5cb81592bfef)
      Tests  10 failed | 19 passed (29)

# unit/killedrun-green6.log (published sha256 2227210d66545602ebb8e07954fff012acd81cce1ad181140b41b35056a9054a)
      Tests  32 passed (32)

# lane-final-harness-391dbbda/run.log (published sha256 7a69a9cc1c2e575cb3e703b83d4472ab858f37e2cafcb7c9f91267bd7e79d5ef)
==> [package-installed-recovery-anchor-before] pass 490s
==> [package-installed-recovery-anchor-sync] pass 477s
==> [package-installed-recovery-helper-before] pass 453s
==> [package-installed-recovery-anchor-after] pass 482s
==> [package-installed-recovery-helper-after] pass 442s
==> [package-installed-recovery-partial-previous] fail status=1 463s
==> [package-installed-recovery-helper-sync] pass 466s
# partial-previous log: "[installed-recovery] PASS: 1 retirement cuts, missing CLI recovery, and next update"
#                       then "[installed-recovery-access] FAILED (exit 1)" (Docker Desktop on macOS host limit)

The original red log has 29 cases because the file had 29 cases at that point in the branch; the merged file has 32.

Manifest
Video Side SHA Command Result MP4 sha256
pr200866-process-base-red-b60b1147460.mp4 base / red b60b1147460 + head test file node scripts/run-vitest.mjs src/cli/update-cli/update-command-killed-run.process.test.ts 13 failed / 19 passed, exit 1 3dbcb0ac2dc752fd83f434d1326e39f341cdfea44077dfa4c159d0d27ad14e87
pr200866-process-head-green-fdf0c95ad6f.mp4 head / green fdf0c95ad6f same 32 passed, exit 0 a01b65854de402ca5a77359b642929693c08eb7394425b569a9aa7c94ea3150e
pr200866-lane-base-red-b60b1147460.mp4 base / red candidate b60b1147460, harness fdf0c95ad6f lane above with OPENCLAW_CURRENT_PACKAGE_TGZ 7 of 7 cuts fail at next-update: exit 1, exit 1 f29e3bede33e27a3dc7e52d70ee52b425b9db728725b6e2c0e56c43d7edf5ba1
pr200866-lane-head-green-fdf0c95ad6f.mp4 head / green fdf0c95ad6f lane above 6 pass; partial-previous harness PASS then access-reader exit 125; lane exit 1 585e4af32236866b4c7e5b1832a2832a7fe9afe3019802e5910b69c071611ffc

Recorded with asciinema 3.2.1 in a 150x50 terminal and rendered with agg 1.9.0 and ffmpeg (idle capped at 1 s, 3x). Sanitizing: runs used a neutral working directory and prompt, and XDG_CACHE_HOME pointed at a neutral copy of the pinned Bun cache so serialized errors do not print a home path; the lane runs used a copy of Node at a neutral path for the same reason. Recorded output was checked for usernames, home paths, host names, emails and tokens; none were found, so no redaction was applied.

Not covered by these recordings: a real Gateway in the installed lane (state 3 runs only in the process test, with a fixture service), state 2 installed, and a Linux host.

RomneyDa added a commit that referenced this pull request Nov 19, 2026
…alled the new version (#200866)

* fix: let the next update finish a killed update that had already installed the new version

When a killed openclaw update had replaced the installed version without
confirming it, had begun rolling its plugin changes back on it, or had left
the Gateway stopped, the next openclaw update refused and named
openclaw update repair. It now settles the plugin recovery as before and then
runs repair's own finalization (Doctor, plugin convergence, Gateway
restoration) as a stage that records its own repair run, prints no result and
never exits, then continues. A stopped Gateway is finished only when the update
would restart it anyway; --no-restart, other unfinished update history, or a
failed finish still refuse and name openclaw update repair. Repair and
standalone finalize are unchanged.

* test(e2e): kill an installed update and let the next update finish it

Each installed-recovery cut now kills an updater in its post-activation Doctor, after it installed its candidate, and checks that the next plain openclaw update finishes that run as repair does before updating.

(cherry picked from commit fdf0c95)

Co-authored-by: RomneyDa <[email protected]>
maplel pushed a commit to maplel/openclaw that referenced this pull request Nov 24, 2026
…aw#194058)

Failed-update triage now captures the operator's environment before managed candidate admission, so a coding agent installed only on the operator's PATH is still offered when the Gateway service's PATH differs. Restores the operator-environment contract from openclaw#134490 and keeps the launch confirmation from openclaw#143139.

Proof: shipped CLI on isolated Linux (Crabbox) with a running systemd Gateway: accept launches the operator-only agent, decline starts nothing, base 18bee8e reports no agent found; published 2026.11.1 upgrades to the fix with settings intact.

Co-authored-by: TorstenW <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: steipete <[email protected]>

(cherry picked from commit 7c702c3)

Release adaptation: Capture invoking operator env before candidate admission, forward to interactive triage only; preserve latest target selectors, confirmation and lease cleanup ordering. Exact three authorized production paths plus real lifecycle regression.

Follow-up dispositions: ad4863d fix: preserve the running installation when an agent updates its Gateway (openclaw#201570); dc73ec0 fix: let updates finish when another tool briefly reads OpenClaw's databases (openclaw#202541); d07b530 fix: clarify PostgreSQL schema upgrades for Git installs (openclaw#202098); e60ea9f test(update): add a Git release upgrade-survivor scenario (openclaw#201956); 2ef6f7b fix(update): build and serve Git releases outside node_modules (openclaw#201917); dbc1aa0 fix: keep the openclaw command and Gateway working after updating a pnpm install (openclaw#201735); f5e7641 fix: Git checkout updates across a schema change no longer end as post-update-failed after the new release starts (openclaw#201600); 2183caf fix: Git checkout updates no longer fail before the new release starts on a schema change or a busy database (openclaw#201463); 47e8649 fix: explain why Doctor cannot restore a scheduled job’s account (openclaw#201550); 8f2cfd4 fix: remove updater-only restrictions from agent maintenance guidance; cb5cfb2 fix: keep a doubtful killed-update recovery on the repair path (openclaw#201361); 24cb734 fix: keep carried-over scheduled jobs running after updates (openclaw#200653); d1276e1 feat(doctor): check OpenClaw ID member roles and honor an optional roles default (openclaw#197785); 0a39956 fix: finish updates when another tool reads OpenClaw's databases during the update (openclaw#201330); ea1c9d5 fix(update): settle remounted package publications before admission (openclaw#201336); 66b5212 fix(update): isolate malformed retained-install markers (openclaw#201199); 7e79c83 fix: let the next update finish a killed source checkout update (openclaw#201009); d905d8a fix: let the next update finish a killed update after the machine restarted (openclaw#200994); fdf0c95 fix: let the next update finish a killed update that had already installed the new version (openclaw#200866); 0c19bcd chore(release): close out 2026.11.5 on main (openclaw#200577); a1940e0 fix(matrix): keep explicit recovery available during deferred migration (openclaw#200805); 18b4776 improve: explain package baseline drift during updates (openclaw#200802); 1ad4cad fix(doctor): reclaim macOS updater runtimes blocked by non-updater processes (openclaw#200732); 427c857 fix: keep one missing archived transcript from blocking every update (openclaw#200733); 802e3f7 fix(update): keep valid cold archives from blocking updates (openclaw#200659); 23fca1a fix: let the next update continue after a killed update when nothing is left to repair (openclaw#200680); 3afe212 fix: let Doctor publish unchanged plugin migrations in any order (openclaw#200658); f65e4db fix(doctor): reclaim runtimes blocked by unrelated Linux processes (openclaw#200657); dab086c fix(update): let candidate Doctor read plugin dependencies from the staged package (openclaw#200595); 3447bee fix(update): keep updates going when the predecessor writes during its stop (openclaw#200569); 0ce9c77 fix: let the next update settle a package publication that a killed update left behind (openclaw#200550); ae31ea3 fix(update): repair handoffs in the journal-pinned lease store (openclaw#200532); 74020ea fix: continue updates when initial SQLite capture is stale (openclaw#200328); 6747b1e feat(update): run Git checkout installs from releases behind the release link (openclaw#199706); e3f8a67 fix(state): keep completed retained agent stores out of startup upgrade (openclaw#200284); 3c512c5 fix(gateway): move managed update lease operations off the main thread (openclaw#200169); ea69fcb chore(release): close out 2026.11.4 on main (openclaw#199956); 618bf31 fix(state): bound startup upgrade copies and pruning to owned state (openclaw#199929); e4a3093 perf(update): replace the candidate canary with a runtime contract check (openclaw#198268); 5dbf569 fix(update): plugin failures never fail an update or Gateway health; 764761e fix(update): refuse missing host prerequisites in one line and record a cause per attempt; 4c4fef4 fix(ui): update dialog claims installation before progress is confirmed (openclaw#199254); 136e1f6 fix(update): retrying an update from a dev checkout is refused after a killed update (openclaw#198673); 3bd03da fix(update): avoid duplicate database copies while the Gateway is stopped (openclaw#198148); 68a839b fix: isolate held agent databases until explicit restoration (openclaw#198180); e333f7e chore(ci): drop retired test-lines allocation records (3/3) (openclaw#197657); fd6fa47 fix: converge Gateway updates with environment-only service overrides (openclaw#196371); 7cf5e75 fix: clarify split-install updates and blocked Doctor repairs (openclaw#196342); 6ff8c86 fix(update): retain lazy sqlite catalog generation (openclaw#197095); 930e1f7 fix: keep stable updates and recovery free of premature migrations (openclaw#196474); a15f737 fix: preserve external plugin data during update rehearsal (openclaw#196301); 92798ae fix: updates survive interrupted heartbeat runs (openclaw#195656); c1e55e2 fix(update): restore LaunchAgent registration after repair contention (openclaw#195406); 715c610 fix(doctor): repair retained ISO session end timestamps (openclaw#194685); 689cfc8 fix(update): reclaim dead closing triage repair leases (openclaw#194503); 86bc89e fix(doctor): keep standing Codex parameter advice out of retirement blockers (openclaw#193650); 691bc8d fix(backup): read the backup engine without copying the live database (openclaw#194234); 000542f fix(backup): backups and updates fail on slow storage when a header probe batch misses its deadline (openclaw#194239); 31a65d5 fix(update): skip --no-lazy-fetch on Git versions without it (openclaw#194198); e45e99d fix(update): preserve dev update sources in tag-only Git clones (openclaw#193109)

Validation: Baseline2 intended operator-agent failures/32 controls passed; candidate34/34passed (194058-green.log). Accept launches synthetic operator-only CLI with expected env, decline starts nothing. Isolated updater flow, not live systemd/upgrade qualification.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 6689fd575ada8fe40a9593784deac18ec73041cd)
(cherry picked from commit 92e7a9fa223b0dc35801f25f70be90b472d9a6b7)
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. scripts Repository scripts size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant