Skip to content

fix: let the next update finish a killed source checkout update - #201009

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

fuller-stack-dev merged 7 commits into
openclaw:mainfrom
fuller-stack-dev:fix/update-finishes-killed-git-update

Conversation

@fuller-stack-dev

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

Copy link
Copy Markdown
Member

What Problem This Solves

When openclaw update on a source (Git) checkout is killed partway through, every later openclaw update refuses until you run openclaw update repair. Package installs stopped needing that step in #200680 and #200866. Checkouts kept it, because the version number of a checkout does not show whether the killed update had already swapped in its new build.

User Impact

User impact: after a killed source-checkout update, the next openclaw update settles the leftover recovery itself and continues, as it already does for package installs. When the checkout was changed by hand afterwards, it still stops and names openclaw update repair.

Why This Change Was Made

An in-place checkout update now records the commit and build it activated, as origin.gitActivation on its run, just before it reserves its plugin recovery. The next update reads that record and checks the checkout on disk. It must still be at that commit, have no local changes, and hold that exact build, complete and made from that commit. Then the checkout runs the killed update's build, and the update uses the same settlement as the package path:

Anything else keeps the refusal, now with the specific reason. That covers runs recorded by older updaters (no record), a pulled, edited, or rebuilt checkout, and a missing or incomplete build.

What I checked in source:

  • The Git runner reserves the cohort only after the runtime swap (src/infra/update-runner-git.ts, activate() then onTransaction). The command-level rollback settles the cohort before it restores the old runtime (src/cli/update-cli/update-command-rollback.ts, settleUpdatePluginCohortInCandidate before packageTransaction.rollback). So whenever a cohort exists, dist is the candidate build.
  • Runtime promotion copies dist/build-info.json byte for byte. relocateRuntimeTree rewrites only .modules.yaml and .bin launchers (src/infra/update-runtime-relocation.ts). A runner test now asserts the live file equals the validated candidate's file.
  • Package-to-Git conversion hands onTransaction to the package exposure swap (src/cli/update-cli/update-command-git.ts), so it never records the fact and keeps refusing. The Git release layout never calls onTransaction and never reserves a cohort, so its behavior is unchanged.
  • openclaw update repair already runs the same settlement and finalization on a checkout, with none of these gates. A new test compares the update's recorded run with repair's for the same killed state and finds them identical.

Update behavior. The installed updater runs first and cannot be patched. On the first update from a published version, nothing changes: published updaters do not record gitActivation, so a run they leave behind still gets today's refusal. The new path applies only once a run recorded by this code is killed. A downgraded updater's origin schema is a non-strict z.object (src/infra/update-run-schema.ts:234 at v2026.11.5), so it drops the key and refuses as today. If an older writer rewrites the row, the record is lost, which is the safe direction.

Storage. One additive, optional key in the existing update_runs.origin_json column. No column, table, schema version, or migration. It is kept as an exact receipt beside origin.driver and origin.packageRelease, and public history projections omit it. Documented in docs/reference/database-schemas/layout.md beside the origin.driver precedent.

Interaction with #200994

#200994 lets the next update accept a killed run whose lease row vanished in a reboot, when every recorded driver ran in an earlier boot of the same machine. This branch now sits on top of it. The two checks prove different things, and the code requires both. The restart rule (or the lease row) shows the updater's processes are gone. The checkout gates (recorded build matches the cohort, HEAD, clean tree, complete matching build) show what is on disk. The gates run in inspectHistory, which runs again under the installation claim, so a reboot never skips them.

The origin codec keeps gitActivation in the exact receipt set. When the origin outgrows 16 KiB, it drops driver namespaces first. If the receipts still do not fit, the write fails, so the record is never silently lost. toPublicUpdateRun strips both the activation and the namespaces.

Evidence

Each killed-run case starts from a real child process that checks out the candidate commit in a real temporary Git repository the test owns, installs its build, records the run and cohort, and is then killed with SIGKILL. The next openclaw update runs from its command entry.

  • Red on base 14b9fc3c8d9: the 10 new checkout cases failed with the old "left by an update of a source checkout" refusal.
  • Merged with main up to 048bb6aab9d (three merge commits; only update-plugin-cohort-settlement.ts and update-run-record.ts conflicted, and both resolutions keep both changes). The killed-run file passes 61/61 on the merged tree.
  • New after the merge: a killed checkout update followed by a reboot (lease store gone, earlier-boot drivers) settles, rolls back, and finishes as repair does. With the same reboot and an untracked file in the checkout, it still refuses and changes nothing. Both tests fail when the matching proof is removed from the code: skipping the Git gates for runs with a recorded boot turns the untracked-file case red, and disabling the restart rule turns the settle case red.
  • New ledger test: maximum drivers with namespaces, a managed handoff and a maximum gitActivation. The stored row loses only the namespaces and keeps the activation exact. A codec that also dropped the activation in its fallback fails it.
  • Controls that keep refusing, each asserting the message, that the update did not proceed, that Doctor did not run, and that the cohort, run status, config bytes, HEAD, tree, and build are unchanged: no record, recorded build or previous build that differs from the cohort, HEAD moved, untracked file, edited tracked file, missing build, incomplete build, build from another commit, and a hand rebuild.
  • Stored data from older versions: a run without gitActivation (what published updaters write) loads and refuses with "did not record which build it activated". The published reader at v2026.11.5 parses origin with a non-strict z.object, which drops the new key.
  • Writer: the run row carries the record, package-style transactions leave it out, and the public projection omits it (update-command-execution.test.ts). The Git runner's transaction names the validated commit and a distinct build ID.

Not proven: a shipped-CLI trace of a real killed source update retried through the published driver, and a real machine reboot (the reboot tests replace the lease store and the boot identity). A killed checkout update that left the Gateway stopped uses the shared stage the package tests cover. The checkout changing between inspection and the claim is handled by rerunning the inspection under the claim, without a dedicated test. Leftover *.openclaw-update-*.tmp runtime backups are not retired by this path, which matches repair.

Commands (merged tree)
  • node scripts/run-vitest.mjs over the killed-run file, execution, cohort settlement and cohort records/recovery/commit, run ledger, compaction, abandonment and record, all update-runner-git* suites, test/scripts/eager-import-closure.test.ts and test/scripts/update-restart-module-outcome.test.ts: 26 files, all passed
  • pnpm tsgo:all, pnpm check:baseline-ratchets --base d905d8a6857 --no-merge-base, pnpm check:docs, git diff --check: all passed
  • Later merges brought in d905d8a6857..048bb6aab9d, which touches no update, cohort, lease or run-ledger file, so the update suites were not rerun for them. tsconfig.core.json typecheck and the ledger file were rerun on the final head after a lint fix in the new ledger test.

An in-place Git update now records the commit and build it activated before it
reserves its plugin recovery. The next openclaw update settles that recovery as
it does for package installs, and finishes the installed build as repair does,
only while the checkout still holds exactly that build: the same commit, a clean
tree, and a build made from that commit with that build ID. Older runs and
moved, edited or rebuilt checkouts keep the refusal that names
openclaw update repair.
The next update now checks the checkout's build the way the updater does
before it restarts a Gateway: build identity, build stamps, entry point and
Control UI assets must all match the activated commit. Untracked files count
as local changes whatever the local Git configuration says. Tests use host
independent Git configuration, distinct build IDs, and cover a mismatched
previous build and an edited tracked file.
Keeps the activation schema module-private, as nothing outside it needs it.
@clawsweeper

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

clawsweeper Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

Records the build activated by an in-place Git update so a later update can automatically finish its interrupted recovery.

Example: A source-checkout update installs build build-candidate for version 2026.12.1 and is killed before verification.

  • Before: The next openclaw update refuses and requires openclaw update repair.
  • After: If the checkout and build still match the recorded activation, the next update settles recovery, finishes the installed build, and continues.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused patch has useful recovery-boundary coverage and no definite source finding, but required runtime and upgrade evidence remains incomplete.
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 source-checkout update requires a separate repair command even when the unchanged installed build can be identified.
Reason: The maintainer-authored direction removes a concrete recovery obstacle while retaining manual repair for older runs and changed or incomplete checkouts.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep this PR open: current main still refuses automatic recovery for source checkouts, and this maintainer-authored patch addresses that gap through existing recovery owners without a definite introduced defect.

Priority: P2
Reviewed head: 070874ca79bbd1f8489cfb02637482cf0880a873

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: Supply a redacted shipped-CLI trace of a real source update killed after activation and successfully retried through actual finalization, plus latest-stable upgrade preservation; reported red/green evidence currently covers the process harness.
Agent review details

How this fits together

CLI update admission reads persisted update history and plugin recovery, checks the installed checkout, and invokes existing settlement and repair finalization before admitting another update.

flowchart TD
A[CLI update] --> B[Read interrupted recovery]
B --> C[Check recorded checkout activation]
C --> D[Existing plugin settlement]
D --> E[Existing repair finalization]
E --> F[Continue update]
C --> G[Explain manual repair]
Loading

Technical review

Best possible solution:

Keep the activation receipt in the existing run ledger and reuse the existing settlement and finalization owners for an unchanged, verified checkout.

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

Current-main source explicitly rejects source-checkout recovery, and the PR reports failing-before/passing-after process cases; this read-only review executed no target code.

Is this the best way to solve the issue?

The defect is missing checkout identity at recovery admission; the invariant is repair-equivalent settlement only for the activated build, and the receipt plus existing runtime verifier provides a focused fix without another recovery owner.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Source-checkout exclusion from automatic settlement changes intended behavior with a stated reason (23fca1a: Package-only recovery could identify the installed core; a checkout version could not establish whether activation had replaced its build.)
  • Git runtime promotion and retained transactions keeps the original intent (8953498: Prepare and verify private source replacements before service interruption, preserving verified rollback through the existing transaction owner.)
  • Exact persisted recovery receipts keeps the original intent (44b5df1: Recovery facts must survive progress writes and bounded diagnostic encoding without losing their operational identities.)
  • Shared repair finalization keeps the original intent (fdf0c95: An interrupted installed candidate needs Doctor, plugin convergence, and Gateway restoration before an ordinary update continues.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Jason (Json): Raw commit 23fca1a adds src/cli/update-cli/update-plugin-cohort-settlement.ts:246 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 23fca1a96393; files: src/cli/update-cli/update-plugin-cohort-settlement.ts)
  • Peter Steinberger: Raw commit 8953498 adds src/infra/update-runner-git-runtime.ts:468 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8953498f8d9a; files: src/infra/update-runner-git-runtime.ts)

PR surface

Source +90, Tests +291, Docs +30. Total +411 across 16 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 8 100 10 +90
Tests 4 305 14 +291
Docs 4 38 8 +30
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 16 443 32 +411

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: A killed source-checkout update requires an avoidable manual repair step, with the existing repair command available to operators.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.

Label justifications:

  • P2: A killed source-checkout update requires an avoidable manual repair step, with the existing repair command available to operators.
  • 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.

  • Provide the source-checkout recovery and latest-stable upgrade evidence identified above, redacting credentials, IPs, phone numbers, and non-public endpoints.

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 18, 2026, 12:27 AM ET / 05:27 UTC.

Keep both openclaw#200994's restart rule and this branch's checkout gates in
inspectInterruptedUpdateRecovery, and strip gitActivation beside the
driver namespaces in toPublicUpdateRun. A killed checkout update after a
reboot settles only when both proofs hold; tests cover it and the origin
codec keeping gitActivation exact when namespaces yield.
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

On the data-model compatibility item: the change adds one optional key to update_runs.origin_json and nothing else.

  • Rows written by published updaters have no gitActivation. The killed-run test "still refuses when the dead update recorded no activated build" loads exactly that row shape and gets today's refusal, with the cohort, run, config, HEAD, tree and build unchanged.
  • Older readers: v2026.11.5 parses origin with a non-strict z.object (src/infra/update-run-schema.ts:234 at that tag), so a downgraded updater drops the key and refuses as it does today.
  • The new ledger test "drops driver boot namespaces, never a checkout activation, when receipts outgrow the origin" shows the record survives the 16 KiB origin budget exactly.

A shipped-CLI trace of a real killed source update is not part of this PR's evidence. The PR body lists it under "Not proven".

@fuller-stack-dev
fuller-stack-dev merged commit 7e79c83 into openclaw:main Nov 18, 2026
146 of 147 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

@fuller-stack-dev
fuller-stack-dev deleted the fix/update-finishes-killed-git-update branch November 18, 2026 07:29
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

Copy link
Copy Markdown
Member Author

Proof recordings: red on base, green on the merge

Terminal recordings of the killed-run process test cases this PR added, run again after merge on this Mac. Head/green uses the merge commit 7e79c830e64. 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.

Base/red uses the merge parent 3c9fb50278d, not the PR's named base 14b9fc3c8d9. The named base predates #200994 (d905d8a6857), and the merged test file contains that PR's restart cases, which would fail there for #200994's reason rather than this one. 3c9fb50278d already has #200994, so every failure below belongs to this PR.

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

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

  • Base / red: product code at 3c9fb50278d, with two test files copied unchanged from 7e79c830e64: the process test and its killed-child helper src/infra/update-run-kill.process.test-support.ts (the helper checks out the candidate commit in the test's own Git repository and records the run). Result: 15 failed | 46 passed (61), exit 1. The finish cases fail because base refuses with the old message: has unfinished recovery; reconcile it before starting another update. It was left by an update of a source checkout. Run openclaw update repair, then retry openclaw update. The checkout controls fail because base gives that same generic refusal, not the specific reason each control expects (local changes, missing or foreign build, build that does not match the plugin recovery).
pr201009-process-base-red-3c9fb50278d.mp4
  • Head / green: 7e79c830e64. Result: 61 passed (61), exit 0.
pr201009-process-head-green-7e79c830e64.mp4
Excerpts from these runs
# base/red 3c9fb50278d (+ head test file and kill helper)
FAIL ... of a source checkout > finishes a dead update that installed its build unconfirmed as repair does
FAIL ... of a source checkout > finishes a dead update killed before the machine restarted as repair does
FAIL ... of a source checkout > keeps the plugin changes of a dead update whose build was verified serving
FAIL ... of a source checkout > records what repair records for a dead update that installed its build unconfirmed
FAIL ... of a source checkout > still refuses when ... (11 controls)
Error: Update <run> has unfinished recovery; reconcile it before starting another update.
  It was left by an update of a source checkout. Run openclaw update repair, then retry openclaw update.
      Tests  15 failed | 46 passed (61)
[test] failed 1 Vitest shard in 476.36s
[test] FAILED (exit 1)

# head/green 7e79c830e64
      Tests  61 passed (61)
[test] passed 1 Vitest shard in 465.62s
From the original run (not a new run)

Mutation reds for the two reboot tests quoted in the PR body, with paths redacted. The SHA was not recorded in the logs.

# unit/red-gate.log (published sha256 05644dab5c75b9f5da83ccc859c0be45f7d44af7af15ce73474d8c6a3acfc1d4)
"still refuses when the machine restarted and the checkout ..."
AssertionError: promise resolved "undefined" instead of rejecting
      Tests  1 failed | 3 passed | 57 skipped (61)

# unit/red-reboot.log (published sha256 e2c86a192927388be9c38ca270962ca5c99207c9aea3759fe879e9ac5f4d0e52)
"finishes a dead update killed before the machine restarted as repair does"
      Tests  1 failed | 60 skipped (61)
Manifest
Video Side SHA Command Result MP4 sha256
pr201009-process-base-red-3c9fb50278d.mp4 base / red 3c9fb50278d + head test file and kill helper node scripts/run-vitest.mjs src/cli/update-cli/update-command-killed-run.process.test.ts 15 failed / 46 passed, exit 1 c52bc47c94f8f3187970cfe6b4f70be79f272c059e82b645fcd02505527881a5
pr201009-process-head-green-7e79c830e64.mp4 head / green 7e79c830e64 same 61 passed, exit 0 e305e28490bf8feca5cded2b917bcdd275749c654ca2a9506e91408427a00571

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: 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. 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 shipped-CLI trace of a real killed source update retried through the published driver, a real machine reboot, and the ledger, execution and update-runner-git* suites named in the PR body.

obviyus added a commit that referenced this pull request Nov 18, 2026
… heartbeat local

- #201009 recorded the commit and build an in-place checkout update activated, so a killed run's plugin cohort could settle. Only the deleted in-place runner wrote it, and Git releases reserve no plugin cohort: they converge plugins after the new release verifies. Remove the writer (the transaction's readGitActivation, its activation input, and the onTransaction record) and its test. The reader and the gitActivation field stay for runs older updaters left.
- main removed STARTUP_MIGRATION_HEARTBEAT_INTERVAL_MS as unused; the state upgrade heartbeat is its only user, so it keeps its interval as a local constant.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 19, 2026
…claw#201009)

* fix: let the next update finish a killed source checkout update

An in-place Git update now records the commit and build it activated before it
reserves its plugin recovery. The next openclaw update settles that recovery as
it does for package installs, and finishes the installed build as repair does,
only while the checkout still holds exactly that build: the same commit, a clean
tree, and a build made from that commit with that build ID. Older runs and
moved, edited or rebuilt checkouts keep the refusal that names
openclaw update repair.

* fix: refuse a killed checkout update whose build is incomplete

The next update now checks the checkout's build the way the updater does
before it restarts a Gateway: build identity, build stamps, entry point and
Control UI assets must all match the activated commit. Untracked files count
as local changes whatever the local Git configuration says. Tests use host
independent Git configuration, distinct build IDs, and cover a mismatched
previous build and an edited tracked file.

* test: fix the checkout activation writer test types and lint

Keeps the activation schema module-private, as nothing outside it needs it.

* test: build namespaced drivers without spreading in map
obviyus added a commit that referenced this pull request Nov 19, 2026
… heartbeat local

- #201009 recorded the commit and build an in-place checkout update activated, so a killed run's plugin cohort could settle. Only the deleted in-place runner wrote it, and Git releases reserve no plugin cohort: they converge plugins after the new release verifies. Remove the writer (the transaction's readGitActivation, its activation input, and the onTransaction record) and its test. The reader and the gitActivation field stay for runs older updaters left.
- main removed STARTUP_MIGRATION_HEARTBEAT_INTERVAL_MS as unused; the state upgrade heartbeat is its only user, so it keeps its interval as a local constant.
RomneyDa added a commit that referenced this pull request Nov 19, 2026
)

* fix: let the next update finish a killed source checkout update

An in-place Git update now records the commit and build it activated before it
reserves its plugin recovery. The next openclaw update settles that recovery as
it does for package installs, and finishes the installed build as repair does,
only while the checkout still holds exactly that build: the same commit, a clean
tree, and a build made from that commit with that build ID. Older runs and
moved, edited or rebuilt checkouts keep the refusal that names
openclaw update repair.

* fix: refuse a killed checkout update whose build is incomplete

The next update now checks the checkout's build the way the updater does
before it restarts a Gateway: build identity, build stamps, entry point and
Control UI assets must all match the activated commit. Untracked files count
as local changes whatever the local Git configuration says. Tests use host
independent Git configuration, distinct build IDs, and cover a mismatched
previous build and an edited tracked file.

* test: fix the checkout activation writer test types and lint

Keeps the activation schema module-private, as nothing outside it needs it.

* test: build namespaced drivers without spreading in map

(cherry picked from commit 7e79c83)

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. size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant