Skip to content

fix: finish a half-switched Git update instead of reporting it current - #201538

Merged
fuller-stack-dev merged 31 commits into
openclaw:mainfrom
fuller-stack-dev:fix/update-git-release-running-build-from-evidence
Nov 19, 2026
Merged

fuller-stack-dev merged 31 commits into
openclaw:mainfrom
fuller-stack-dev:fix/update-git-release-running-build-from-evidence

Conversation

@fuller-stack-dev

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

Copy link
Copy Markdown
Member

What Problem This Solves

On a Git checkout install that runs from releases, an update can fail after it switched the release link but before any Gateway started the new release. The next openclaw update then treated that never-started release as the one serving. If the target was that same release it reported "already current" and the Gateway stayed on the old build. If the target was newer, it recorded the never-started release as the new trial's fallback, so a candidate that failed to start fell back to a build that had never run. Each attempt also left another full build on disk.

User Impact

User impact: the next plain openclaw update repairs a half-switched Git install. If the target is the release already placed, the update finishes its activation without rebuilding. If the target is newer, the fallback stays the release that last served and the superseded release is deselected; release collection removes it once it has been deselected for 24 hours. Nothing manual is needed.

Why This Change Was Made

Root cause: updateGitRelease (src/infra/update-runner-git-release.ts) used the release link as the running release (running = slot), and publishGitRelease recorded whatever the link named as the trial's previous. The link records what the next start should load, not what serves. After an update fails between the switch and the restart, the link names a release whose trial is still armed with attempts: 0. The trial record's previous is the release that served.

Competing hypothesis: the false already-current came from the tree comparison or from beforeRuntimeVerified. Falsifier: with the same leftover and the same tree comparison, reading the serving release from the trial record turns the RED case green, and no change to the comparison is needed. The new runner tests fail on base for exactly this reason (expected 'skipped' to be 'ok', trial previous = the never-served release).

Why the link was used: #199706 uses it so the serving release is found even when the CLI runs from the preserved checkout. That still holds. The link's release is still used whenever there is no trial, the trial has passed, the launcher counted a start, or a process holds a lease on it. A started trial stays under the launcher, which owns its state rollback, exactly as before.

The fix has one owner: readGitReleasePlacement in src/infra/git-release.ts reads the trial record and the leases and returns:

  • serving: what serves;
  • fallback: the release that last passed a trial;
  • unserved: the placed release, only when it never started (attempts: 0 and no live lease).

It uses only the existing trial fields and lease files. The runner then:

  • Builds on the serving release. before, the already-current check and failure recovery use serving, not the link.

  • Target is the placed release: the target is admitted through the caller's normal inspection hook, which is also where the CLI observes the service it will restart. The placed release is reused only if three things hold: its build verifies, the candidate worktree is checked out at the revision after local-commit replay, and that tree is the placed tree. The check runs before any install or build. The reused release then runs the ordinary candidate validator, and its armed trial is kept. The normal restart, verification and trial settlement follow.

  • Target is newer: at the normal switch point, supersedeUnservedGitRelease rereads the trial. If the placed release is still never-started and on its trial, it puts the link back on the fallback and clears the stale trial. It does not delete the placed release: an openclaw started through the link may be running from it. The shared collector removes it later, under its rules (not selected, no live lease, not named by an open run, not the running updater's own release, deselected more than 24 h ago). If the release started, or its trial ended while the target built, nothing is touched and the new trial records what the link names. The new release then goes on trial.

  • Serving release is the target: the link goes back to it, the placed release is deselected (left to collection), and the result is already-current. If the placed release started or ended its trial meanwhile, nothing changes and the result is git-release-selection-changed.

  • Collection keeps the fallback, even when the link left it more than 24 h ago. Before this, a fallback older than 24 h could be collected while it was still the trial's previous.

  • Result note: a git-release-placement note names both releases and says what the update did.

  • Link writes resolve. publishGitRelease, the only writer of the link, computes the link text between real paths and checks that it resolves to the chosen release before it replaces the old link. Re-arming a trial for the release the link already names keeps that release's trial, so a trial never falls back to its own target.

State table

Notation:

  • A: the release that served last (the fallback).
  • B: the release the link or a deferred trial names.
  • C: the target.
  • src/infra/update-runner-git-release.test.ts holds every owner test named here.

Every link write goes through publishGitRelease. It computes the link text between real paths and checks that it resolves to the chosen release before replacing the old link. The linked-state-directory cases cover each kind of write.

# What serves Link names Trial (target / fallback / attempts) Lease on B Target Action Test
1 A A none – C Build C, switch, arm trial C → A. "rebuilds a same-commit release…" and the existing launcher cases in git-release.test.ts
2 A A none – A (verifies) already-current, nothing changes. "reports a current release as prepared…"
3 the checkout at A's commit, or A B B / A / 0, no lease directory exists under releases/.leases/, and A's commit is the checkout's built commit (the only served evidence on disk) no C = B, and B verifies Admit C, check the match after replay, validate B, reuse it. The trial is kept. "finishes activating a placed release…"
3a as 3 B B / A / 0 no C = B, but replay changes the tree Build normally. "builds instead of reusing when local replay changes the target"
3b as 3 B B / A / 0 no C = B, but B does not verify Build normally. "builds instead of reusing when the placed build does not verify"
3d as 3 B B / A / 0 no C = B, but B has tracked edits, or Git cannot read its index Build normally. "builds instead of reusing when the placed worktree has tracked edits / Git cannot read the placed worktree's index"
3e unknown B B / A / 0, but A's commit is not the checkout's built commit, or a Gateway has run from a release (any lease directory, even from a boot that died) no any, with a restart Change nothing; git-release-fallback-unavailable, not safe to restart, openclaw triage. No rebuild. "changes nothing and refuses when the fallback has no evidence that it serves / is incomplete and a Gateway took a release lease"
3c as 3, and the launcher starts B during validation B B / A / ≥1 – C = B Keep the trial with fallback A. A trial never falls back to its own target. "finishes activating a placed release that never served, also when the launcher starts it during validation"
4 A B B / A / 0 no C newer At the switch: reread; link → A, B deselected and left to collection; arm C → A. "falls back to the serving release and deselects…" (includes the launcher back-out)
4a A, and B ends its trial during the build B none – C newer Leave link and trial; arm C → B (what the link names). "keeps the link on a release that ended its trial while the target built"
5 A B B / A / 0 no C = A Run candidate checks on A, then the caller's mutation check, then link → A, B deselected; already-current. "puts the link back on the serving release when that release is the target" (includes the refused mutation check)
5a B, which ended its trial while A was checked B none – C = A Leave link and trial; git-release-selection-changed, not already-current. "does not report the serving target current once the placed release ends its trial"
6 A or B B B / A / ≥1 – any Launcher-owned, unchanged from main. "leaves a trial whose release was started by the launcher to the launcher"
6a B B B / A / any yes any Launcher-owned, unchanged from main. "…leased by a running process to the launcher"
7 A A pending B / A no C newer Link → A, pending trial cleared, B left to collection; arm C → A. "a release a --no-restart update left: deselects it once superseded"
7a A A pending B / A no C = B Reuse B; arm B → A. "a release a --no-restart update left: reuses it when it is the target"
7b A (or the checkout) B B / A / 0 no any, with --no-restart No repair: the link's release counts as running, exactly as before this change. A same-tree retry keeps the armed trial untouched. The result says this update does not repair it; it does not promise a later repair (see Follow-ups). "leaves the half-switched link and trial alone under --no-restart for a newer / the placed target"
8 the checkout at A's commit B B / A (incomplete) / 0, no lease directory, and A's commit is the checkout's built commit no any, with a restart Rebuild A's commit as R, or reuse an earlier rebuild. Nothing switches before C passes its checks; at the switch R is the fallback. "rebuilds the serving commit as the fallback when it does not verify", "keeps the link and trial, and one rebuild, while the target keeps failing"
9 unknown B B / A missing, or A without Git metadata / 0 no any Change nothing; git-release-fallback-unavailable, not safe to restart, openclaw triage. "changes nothing and refuses when the fallback is gone / lost its Git metadata"
10 any any any any any write under a linked state directory Real-path link text, verified before replacing. "writes a link that resolves under a linked state directory for a newer / the placed / the serving target", "rebuilds the serving commit as the fallback when it does not verify under a linked state directory"

There is no new config key, stored field, schema or protocol. Releases are removed only by the shared collector; the one retention change is that the Git collector also keeps the release the running updater executes from (compared by real path).

Update behavior: this runs in the installed updater, which for a Git checkout is the checkout's own build. An updater built before this change keeps the old behavior until the checkout runs a build with it.

A safe fallback. A back-out must always land on a working Gateway. The fallback must therefore be a build of the commit that serves right now, present and intact: its build-info, build and runtime stamps, entry and Control UI must verify against the commit its worktree has checked out.

  • Normal case: the trial's previous is that build. In a conversion leftover, the Gateway still runs the plain checkout through the old service definition, and previous is the first release built from the commit the checkout's dist serves.
  • Evidence that previous serves: the only reliable evidence on disk is the state a conversion leaves before its first restart: no Gateway has run from any release (no directory under releases/.leases/; every Gateway that runs from a release takes a lease there first, and the directory stays until the release is collected), so the service still runs the checkout, and the checkout's own dist/build-info.json reports previous's commit. Nothing on disk records that a trial passed (settling deletes the record), a Gateway takes its release lease before it is ready, and the runner cannot ask the serving Gateway for its build. Without that evidence the update changes nothing and refuses (row 3e). So this PR repairs leftovers whose fallback is the checkout's built commit; other leftovers get the triage handoff.
  • previous present but incomplete, with that evidence: the update rebuilds that commit as a new release, as the conversion does for its first release, and verifies it. The link moves to it only at the normal switch point, after the target passed its checks and the caller's mutation hook. A rejected target leaves the link and trial as they were.
  • previous gone, or no longer readable as a Git release: the runner has no record of the serving commit. The checkout's dist is not proof that the service runs it. So the update switches nothing and ends as a retryable failure, git-release-fallback-unavailable, with serviceRestartSafe: false. The message says the Gateway keeps serving, not to restart it into the release link, and to run openclaw triage so an agent can rebuild a fallback from the serving commit.
  • Why the gone case can still happen: with this change, collection keeps the fallback, so a fixed updater never removes it. It can still be gone if an older updater's 24 h collection removed it.
  • Never a fallback: a never-started release is never recorded as a fallback by this path.

This fix is also what lets an install leave the state that shipped 8f80fe08 updaters create after #201327. They fail in their own process with a false "Agent database migration did not finish" and leave this same half-switched leftover. The next update from an updater with this change finishes or supersedes it.

Evidence

Owner tests (real Git worktrees, the real publishGitRelease, and the real launcher process for the back-out): src/infra/update-runner-git-release.test.ts has 33 cases at the head, and every rating or landing finding's case fails with the production files of the round that raised it.

  • the placed target is activated without a build, and the target is still admitted through the caller's inspection hook;
  • a newer target falls back to the serving release, the never-served release stays for collection, and after two failed candidate starts the launcher serves 1.0.0 again;
  • a trial whose release the launcher started, or that a process holds, is left to the launcher;
  • a release that ends its trial while the target builds keeps the link;
  • local replay or an unverified placed build means a fresh build instead of reuse;
  • a --no-restart leftover is deselected when superseded;
  • a serving target puts the link back;
  • an incomplete fallback whose commit the checkout's build reports is rebuilt from that commit and becomes previous;
  • a missing fallback, one without Git metadata, or one without served evidence (including one after any Gateway took a release lease) changes nothing and refuses with the triage route.

End to end, through the real openclaw update on isolated macOS launchd Git release-mode installs. Each install has its own profile, state directory and port, and a synthetic config with no channels, providers or credentials. Upstream is a local bare repository with three target commits:

  • t1 and t2 change only a docs file;
  • t2bad makes startGatewayServerCore throw at start, standing in for the observed out-of-disk boot refusal.

The installed updater is the checkout's own build: base 3eee09d9b462 or 8c5eae462c7 for RED, the PR head 006574e776e6 for GREEN.

The leftover is made by a real first update to t1, killed the moment releases/.trial appears. The result is the incident's shape:

  • the link names the t1 release, which never started;
  • .trial is armed (attempts: 0) with the first release as previous;
  • the service still runs the checkout through its old definition.

Each cell runs one plain openclaw update --channel dev --yes from that leftover. Downtime is the Gateway port polled every 0.5 s.

Cell Code Result Time Downtime Releases after
RED (a) target = placed t1 base skipped: already-current, exit 0, after a full duplicate build. The Gateway still serves the old checkout build. 214 s 0 s 2 (8.4 GB)
RED (b) target t2 base "updated … (from 7138ac46)", the never-started build. Three full builds are left on disk. 266 s 21.7 s 3 (13 GB)
RED (run from the link) updater started through the release link, so it runs from never-started t1; target t2 8c5eae462c7 Stops in validation with source-artifact-ownership, exit 1, nothing changed; the updater's release stays. The removal under the running updater is not reached here (see landing round 3). 36 s 0 s 2 (8.4 GB)
GREEN (a) target = placed t1 head Reused, with no candidate build (validation only). The unit is rewritten to the launcher, the Gateway serves t1, the trial is settled. Exit 0. 178 s 20.0 s 2 (8.4 GB)
GREEN (c) target t2bad, fails both starts head The link goes back to the fallback, the never-started t1 stays for collection, and t2bad goes on trial → fallback. It fails twice and the launcher switches back. The Gateway serves the fallback release of 006574e7 (working), the link names it, and no trial is left. Exit 1 build-id-mismatch. 238 s 34.5 s 3 (13 GB)
GREEN (d) fallback made incomplete, target t2bad head The serving commit is rebuilt and becomes the fallback at the switch; t1 stays for collection. t2bad fails twice and the launcher switches back to the rebuilt release (working Gateway, build 006574e7). Exit 1 build-id-mismatch. 478 s 45.3 s 4 (17 GB)
GREEN (run from the link) as RED (run from the link) head Same pre-mutation stop (source-artifact-ownership); the updater's release stays. 40 s 0 s 2 (8.4 GB)

The superseded t1 release now stays on disk until a later update's collection finds it deselected for more than 24 h, which is why GREEN (c) and (d) end with one more release than before this round. The linked-state-directory cell (link text resolving under a symlinked state directory) last ran at 288d4f6f1e2f; this round changes no link writes.

None of the cells hit the false post-update-failed fixed by #201600; the targets carry no schema bump. Other heavy jobs shared the machine, so times vary between rounds.

Recordings (raw terminal captures, sanitized, 3x speed with idle time capped at 1 s). Full raw logs are not attached because the Crabbox artifact store rejected the upload from this machine (http 401).

Owner tests at the head: RED with the base production files (20 of 32 fail), then GREEN:

v5-unit-red.mp4
v5-unit-green.mp4

Run from the release link: RED at 8c5eae462c7, then GREEN at the head:

v5-red-selfdel.mp4
v5-green-selfdel.mp4

End to end: RED (a) and RED (b) on base, then GREEN (a), (c) and (d) at the head:

e2e-red-a.mp4
e2e-red-b.mp4
v5-green-a.mp4
v5-green-c.mp4
v5-green-d.mp4

After merging #201917 (releases at git-install/openclaw -> releases/<id>/openclaw), at head 153c8aa733df:

  • GREEN (a), target = placed t1: reused without a build, the Gateway serves t1, trial settled. Exit 0, 164 s, 16.7 s downtime, 2 releases.
  • GREEN (c), target t2bad: link back on the fallback, never-started t1 kept for collection, t2bad fails twice, the launcher switches back to the fallback release (releases/<id>/openclaw), which serves (build 153c8aa733df). Exit 1 build-id-mismatch, 256 s, 36.6 s downtime, 3 releases.
v6-green-a.mp4
v6-green-c.mp4
Checks
  • OPENCLAW_VITEST_RUNTIME=node node scripts/run-vitest.mjs src/infra/update-runner-git-release.test.ts src/infra/git-release.test.ts src/cli/update-cli/update-command-verification.test.ts src/infra/package-release-retention.test.ts: pass (the launcher cases skip under Bun, so they were run under Node)
  • pnpm tsgo:core, pnpm tsgo:core:test: pass
  • node scripts/run-oxlint.mjs on the touched files: pass
  • pnpm check:baseline-ratchets --base <merge base> --no-merge-base: all ok, net test lines +399 (allowance 400; tests were consolidated to stay within it)
  • pnpm check:docs: pass
  • PR CI: see the checks on this PR for the current head. The PostgreSQL conformance (1/4) failure on the first head was server-database-engine-cron.postgres.test.ts failing with ECONNREFUSED on a Gateway port. That code is untouched here, and the same shard passed on the next two heads with no change in that area.
  • git diff --check: clean

Test file audited in full: src/infra/update-runner-git-release.test.ts.

  • The target-selection mock now builds the selected revision, calls beforeCandidate before building as the real preflight does, and registers the real preflight's cleanup.
  • The recovery mock compares real paths, because the running root is now the release path, not the link path.
  • Nothing was removed.

Independent review: a fresh read-only reviewer (Opus) checked the diff against the behavior contract. Fixed:

  • a failed switch back to the fallback no longer continues (it fails the update);
  • the "never started" check is reread right before the switch;
  • the placed release is reused before the build, not after it;
  • a leased link release counts as serving;
  • lease reads use the resolved prefix;
  • --no-restart and missing-fallback messages are accurate;
  • the reuse decision rereads the link;
  • one release-ID helper;
  • tests: keep-list ageing in the reuse case, no-build and message assertions, the pending case, and a launcher timeout.

ClawSweeper rating, round 1 (at 6917f1fb32f5): overall F / proof C / patch F. Every src/ finding was checked against the code; all were real, and all are fixed at the current head. Each has a regression test, and 7 of the head's 16 owner tests fail on the round-1 production files.

  • P1, counted start loses the launcher's rollback. A trial whose release the launcher started, or that a process holds, now stays under the launcher, as on main. Test: "leaves a trial whose release was started by the launcher / leased by a running process to the launcher".
  • P1, a release that ended its trial during the build. The reread just before the switch now leaves the link and trial alone. Test: "keeps the link on a release that ended its trial while the target built".
  • P1, reuse before local replay. The match now requires the candidate worktree to be checked out at the post-replay revision. Test: "builds instead of reusing when local replay changes the target".
  • P1, reuse skipped candidate validation. The reused release now runs validateCandidate. Asserted in the reuse test.
  • P2, unverified placed release reused. Reuse now requires its build to verify. Test: "builds instead of reusing a placed release whose build does not verify".
  • P1, fallback rebuild moved the link before the activation boundary. The rebuilt fallback is now selected only at the normal switch point.
  • P2, fallback without Git metadata ended as git-root-unresolved. It now refuses with git-release-fallback-unavailable. Test: "changes nothing and refuses when the fallback lost its Git metadata".
  • Low-value test (full advisory string). Now asserts the release IDs and the action instead.
  • Rejected: proof from the latest stable release. No stable or beta tag runs Git releases. The layout is main-only since feat(update): run Git checkout installs from releases behind the release link #199706, and a stable checkout takes the in-place runner, so a cell from stable cannot reach this code. The installed updater for a Git install is the checkout's own build, which is what the cells use.

ClawSweeper rating at the landing gate (bb046699b91d): overall F / proof B / patch F. All of its findings were real and are fixed. Each fix has a regression test that fails with the bb046699b91d production files and passes at the head.

  • P1, a dangling link under a linked state directory. With the state directory under macOS /tmp, the link text was computed from /tmp but resolved from /private/tmp. Tests: "writes a link that resolves under a linked state directory for a newer / the placed / the serving target" and "rebuilds the serving commit as the fallback when it does not verify under a linked state directory".
  • P1, a reused release could lose its rollback when the launcher started it during validation. Test: "keeps the fallback when the launcher starts the reused release during validation".
  • P2, the serving-target path changed the link before the caller's mutation check. Test: "runs the caller's mutation check before putting the link back on the serving target".
  • P2, every retry rebuilt another fallback. Retries now reuse an earlier verified rebuild. Test: "keeps the link and trial, and one rebuild, while the target keeps failing". That test also covers the round-1 fix that the link moves to a rebuilt fallback only at the switch point; it fails with the round-1 production files (6917f1fb32f5), where that move happened early.
  • Low-value assertion on advisory wording: removed. The release identity, build count and trial state assertions remain.

ClawSweeper rating, round 2 (my run, at 9ce59465731819c): overall F / proof C / patch F.

  • Fixed (P1): --no-restart with a leftover moved the link. That would make a launcher-backed Gateway restart, and it consumed the pending release. Under --no-restart the update now does no repair at all and says so (row 7b).
  • Fixed (P2): the serving-target path skipped candidate checks before the caller's mutation check, which database.families admission needs. The serving release now goes through validateCandidate first (row 5).
  • Fixed (P2): a placed worktree with tracked edits could be reused. Reuse now requires a clean tracked tree (row 3d).
  • Fixed (P3): the docs now say what happens when the old trial ends during a build.
  • Rejected (P2): leave deletion of the placed release to the shared collector. The brief requires that a superseded never-started release does not accumulate, and the 24 h grace period is what produced 13 GB of leftover builds. The removal is limited to a release whose trial this same flow armed: the launcher counted no start, no live lease exists at the reread just before the switch, and the lease is checked again at removal. The remaining window is a process started from the slot path without the launcher and without a lease yet, in the milliseconds before removal. That window is listed under Not proven.

The three fixed findings each have a regression test that fails with the round-2 production files and passes at the head.

ClawSweeper rating, round 3 (my run, at df814eb7aba3): overall F / proof C / patch F.

  • Fixed (P1): a same-tree retry under --no-restart replaced the armed trial. It now behaves exactly as before this change and keeps the trial (row 7b).
  • Fixed (P1): a trial written by an older publisher can name a fallback that never started. A fallback is now trusted only with evidence that it served: a Gateway took a release lease on it (the lease directory outlives the lease), or it is the first release, built from the commit the checkout's own build serves. Without that evidence the update makes no repair (row 3e).
  • Fixed (P2): a failed git status read as clean. Reuse now requires exit 0 (row 3d).
  • Partly fixed (P2): collectGitReleases passed the unresolved prefix. Under a symlinked state directory, the shared collector then did nothing. It now uses the link's resolved prefix.
  • Rejected (P2): share the removal code with the collector. Same reasoning as in round 2. The single-release removal is kept, and changing the shared retention owner is out of scope here.

The three fixed findings each have a regression test that fails with the round-3 production files and passes at the head.

autoreview does not run on this machine.

Landing round 2 (at 2d4a72ab545). Blocker: the served-evidence check ran only when the fallback verified, so an incomplete fallback had its commit rebuilt with no evidence that it ever served; and a lease directory counted as evidence, though a Gateway that dies during boot leaves one. Fixed with one rule in readGitReleasePlacement: a fallback is used, or its commit rebuilt, only when the checkout's built commit equals the fallback's commit. Otherwise unsafeFallback.reason is unproven, no commit is offered, and the runner refuses before any build or switch. The --no-restart advisory no longer promises a later repair. Tests:

  • incomplete fallback whose only sign of serving is a lease directory, as a Gateway that died during boot leaves: nothing built, link and trial unchanged, refusal ("is incomplete and a Gateway took a release lease");
  • fallback without evidence: refusal ("has no evidence that it serves");
  • incomplete fallback with evidence: rebuilt and used as the fallback ("rebuilds the serving commit as the fallback when it does not verify");
  • the normal no-leftover update: unchanged ("rebuilds a same-commit release…", "reports a current release as prepared…").

The two new refusal rows fail with the 2d4a72ab545 production files and pass at the head; the other 27 owner tests pass on both.

ClawSweeper rating, round 4 (my run, at b9aec0b986e8): overall F / proof C / patch F.

  • Fixed (P1): the checkout's built commit is not proof once the service runs releases. After a completed conversion the checkout's dist stays at the conversion commit while releases serve, so a trial whose fallback has that commit but never served would have been accepted. Evidence now also requires that no Gateway has ever run from a release: any directory under releases/.leases/ (a Gateway takes its lease before it is ready, and the directory outlives it) means refusal. The other half of that finding, that an intact fallback on a converted install is refused, is the intended minimum: without a record of what serves, the update hands off with git-release-fallback-unavailable instead of guessing. Test: "changes nothing and refuses when the fallback is incomplete and a Gateway took a release lease" (row 3e).
  • Fixed (P2): already-current after the placed release ended its trial. When the target is the serving release and the placed release starts or ends its trial during the checks, the update now fails with git-release-selection-changed and leaves the link and trial alone (row 5a).
  • Fixed (low-value test): the linked-state-directory cases compared the resolved link with itself for the newer target. They now check that the link resolves to a worktree at the requested commit.
  • Not changed (P2): removal outside the shared collector. Listed under Follow-ups, as decided at the landing gate.

Both fixed findings have a regression test that fails with the round-4 production files and passes at the head.

Landing round 3 (at 8c5eae462c7). Blocker: the update could delete the release the running updater executes from. supersedeUnservedGitRelease removed the never-started release B once the link left it, and update-command.ts keeps no copy of a Git release updater because "a Git release update never rewrites the tree this updater runs from".

  • Reproduction attempt (real run, base 8c5eae462c7): conversion leftover (link on never-started t1 release B, trial B → A, service still on the checkout), then openclaw update --channel dev --yes started through the release link, so the updater ran from B (OpenClaw 2026.11.5 (2caf798)), target t2. The run stopped in validation with source-artifact-ownership ("Stripping types is currently unsupported for files under node_modules"), exit 1, nothing changed, B still on disk. Why: gatewayServiceOwnsGitInstall (update-command-git.ts:668) finds the service on the checkout, not the release slot, so a run from B takes the in-place runner, and admitSourceUpdateArtifacts(B) fails before mutation. In a converted install (service on the launcher), a never-started B with attempts: 0 and a fallback that counts as served needs no lease directory under releases/.leases, which every Gateway that ever ran from a release leaves. So on the base, removal of the updater's own release is reachable only when the Gateway's best-effort lease write failed. The unit test below reproduces the removal directly; the guard holds whether or not a path reaches it.
  • Fix: the bespoke removal is gone. Supersede only re-points the link to the fallback and clears the stale trial; the placed release is left to collectGitReleases, the shared collector, which also keeps the release the running updater executes from (resolveOpenClawPackageRootSync on the updater's own module, compared by real path on both sides, symlinked state directory included). The deselection stamps the release, so the collector's 24 h grace applies. No new lease type, stored field or retention rule beyond that keep.
  • Tests (red on 8c5eae462c7, green at the head): "falls back to the serving release and deselects a superseded release that never served" (B survives the update; the launcher back-out still lands on 1.0.0); "collects a deselected release only once it is old and not the updater's own" (an aged, deselected B named as the running updater's root through the symlinked state directory is kept; without that it is collected). All 42 earlier owner tests stay green.
  • P2, early failure reported serviceRestartSafe: true with no safe fallback: fixed. When the placement has an unsafe fallback, the runner's recovery verdict is serviceRestartSafe: false from the start. Trace on the base: the only consumer that restarts on true is maybeRestartServiceAfterFailedMutableUpdate (via update-command-post-update.ts:305), which returns early unless the updater stopped the service (before.stopped) or rebound it. A Git release update stops nothing before activation (servicePrepared = params.gitRelease === true, update-command-execution.ts:423), and the early failures (channel, root, fetch) come before activation, so no restart happened. The verdict was still recorded in the run history and shown in recovery guidance (update-recovery-guidance.ts:66, 164) as safe to restart, which was not true. Test: the refusal cases now also run a fetch failure first and expect serviceRestartSafe: false.
  • P1, an interrupted first conversion whose checkout is rebuilt at B makes B look served: not changed here; the build-ID follow-up below removes it.
Path in the diff that deletes, moves or re-points Who could be using it now What protects them
publishGitRelease switching the link to the target and arming its trial (normal switch point) Serving Gateway (follows the link on its next maintenance tick); running updater; launcher Same switch point as main, after candidate checks and the caller's mutation check. The link text resolves to the release before the rename. The updater's files are not touched. A started trial was excluded earlier: the placement leaves it to the launcher.
supersedeUnservedGitRelease: link back to the fallback, stale trial cleared (B deselected, not deleted) Launcher mid-trial on B; Gateway; updater running from B Placement is reread immediately before the switch: B must still have attempts: 0 and no live lease, or nothing is touched (git-release-selection-changed on the serving-target path). The Gateway serves the fallback the link now names. B's files stay.
Reuse with a rebuilt fallback: link to the rebuilt fallback, then re-arm B's trial Launcher mid-trial on B Reread: only while B is still the selected never-started release.
collectGitReleases (the only deletion of releases) Serving Gateway; running updater; launcher's fallback; a concurrent update's new release Shared collector: never the selected release, a release with a live lease, or one changed or deselected in the last 24 h (its open-update-run check names package releases only, not Git releases). This update also keeps its target, fallback and serving release, and now the release its own updater runs from (real paths).
Trial record removal (publishGitRelease with trial: false, settleGitReleaseTrial) Launcher reading the trial Unchanged from main. On the supersede path it happens only after the reread above.
Rebuilt fallback removed when its fresh rebuild fails verification Nobody Built by this run, never linked, no trial names it. An earlier attempt's rebuild is reused, never removed.
Empty release directory removed when the placed release matches the target Nobody Created by this run moments before; never linked.
git worktree prune Git metadata only Forgets only worktrees whose directories are gone.

ClawSweeper rating, round 5 (my run, at 961840de1bbd): overall F / proof C / patch F.

  • Fixed (P1): a fallback without the launcher's entry counted as intact. The launcher imports dist/index.js, which the runtime verification did not check. verifiesAsGitRelease now requires it, for an existing fallback, an earlier rebuild and a fresh rebuild alike. Test: "rebuilds the serving commit as the fallback when it lacks the launcher's entry" (red on 961840de1bbd).
  • Fixed (P2, message): the note promised collection after 24 h, but collection runs only in an update that publishes a release. The note and docs now say so.
  • Fixed (low-value test): the launcher-owned cases now assert the next trial's fallback instead of the directory's existence.
  • Not changed (P1): checkout-commit evidence after an interrupted conversion whose checkout was rebuilt, and in linked worktrees. Listed under Follow-ups; the serving-evidence follow-up replaces this evidence with the running Gateway's build ID.
  • Not changed (P2): a rebuilt fallback that is also the requested target is built a second time as the target. The update still ends correctly or fails before any switch; listed under Follow-ups.

Landing round 4 (at 006574e776e6). All four findings were real; each has a test that fails with the 006574e776e6 production files and passes at the head.

  • Blocker (b): evidence came from the wrong checkout when the install's checkout is a linked worktree. isCheckoutServingCommit derived "the checkout" from the release's Git common directory, which for a linked worktree belongs to the main repository. It now reads the install's own checkout, passed in by the runner (gitRoot). Tests use a real linked-worktree checkout: "finishes activating a placed release that never served, with a linked-worktree checkout" (its own build at 1.0.0 is accepted while the repository is built at 2.0.0) and "changes nothing and refuses when the fallback never started and only its repository's build reports it".
  • The launcher's entry may not be a directory. verifiesAsGitRelease now requires dist/index.js to be a regular file. Test: "rebuilds the serving commit as the fallback when it has a directory where the launcher's entry belongs".
  • git-release-selection-changed carried the old restart verdict. It now reports serviceRestartSafe: false, because the next start runs the other release. Asserted in "does not report the serving target current once the placed release ends its trial".
  • The fallback-unavailable message claimed the Gateway keeps serving without checking. It now says only that nothing was changed. Docs updated the same way.
  • Merged main with fix(update): build and serve Git releases outside node_modules #201917, which moved Git releases out of lib/node_modules (git-install/openclaw -> releases/<id>/openclaw). The release ID, the earlier-rebuild lookup and the rebuilt-release removal now use packageReleasePrefixOfRoot, so they work for both layouts. A leftover still under the earlier lib/node_modules link is migrated by fix(update): build and serve Git releases outside node_modules #201917's path (rebuild the serving commit at the new path), not repaired by this placement logic.
  • Test lines stay at +399 of 400: the linked-worktree accept case is a row of the existing reuse table, the refuse case a row of the refusal table, and one rebuild row that the "keeps the link and trial, and one rebuild" test already covers was folded away.

Follow-ups

  • When the requested target is the commit of an incomplete fallback, the rebuilt fallback is not reused as the target; the update builds that commit a second time.
  • A superseded release deselected by an update that publishes nothing (the serving-target path) waits for the next update that publishes a release before collection can remove it.
  • The shared collector's open-update-run check names package releases only. Git release runs record no packageRelease, so a Git release is protected by selection, leases, this update's keep list and the 24 h grace, not by the open-run check.
  • An interrupted first conversion whose checkout is then rebuilt at the placed commit makes the placed release look served by the checkout-commit evidence. Matching the running Gateway's build ID (the serving-evidence follow-up) removes this.
  • A half-switched leftover still on the earlier lib/node_modules link (main builds before fix(update): build and serve Git releases outside node_modules #201917) goes through fix(update): build and serve Git releases outside node_modules #201917's migration, which rebuilds the serving commit at the new path from the link's release; the placement repair here reads only the new link.
  • openclaw update started through the release link during a conversion leftover stops in validation with source-artifact-ownership and a type-stripping error. Nothing changes, but the message does not say what to do. Running it from the checkout works.
  • On a converted install, an update interrupted during activation (observed in the e2e harness) recovered the Gateway before exiting, so the launcher starts the placed release (attempts: 1) and owns the trial. A leftover with attempts: 0 there needs the Gateway to stay down, which the serving-evidence follow-up handles.
  • --no-restart with a leftover keeps the old trial (C → B). It no longer promises that a later update repairs it; whether a later update can repair that state is not decided here.
  • Reading the serving commit from the running Gateway would let the update repair leftovers whose fallback is not the checkout's built commit.

Not proven

  • A fallback that is gone, or has no served evidence, is handed to an agent (openclaw triage) and is not repaired automatically.

  • A trial the launcher started is left as on main, where an update that supersedes it clears its trial. That is existing launcher-owned behavior, not changed here.

  • When the target carries local commits, the placed-release match runs after replay, so the replay itself is repeated (no install or build).

  • Platforms: macOS launchd only.

  • A Gateway whose release lease could not be written (the lease is best effort) leaves no lease directory, so the checkout's build would still count as evidence while that Gateway serves a release.

The GREEN end-to-end cells ran at head 153c8aa733df.

@clawsweeper

clawsweeper Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

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

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: L labels Nov 19, 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. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 19, 2026
@clawsweeper

clawsweeper Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR recovers interrupted Git release updates by distinguishing the selected release from the serving release and preserving the fallback.

Example: Release 1.0.0 serves while the link selects never-started release 2.0.0.

  • Before: Updating to 2.0.0 reports already-current and leaves activation unfinished.
  • After: The update reuses 2.0.0 and completes activation with 1.0.0 retained as its fallback.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The recovery goal is valuable, but the patch bypasses two existing lifecycle contracts and lacks completed proof of its shipped behavior.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 2 actionable review findings remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A repeated Git checkout update can report already-current while the Gateway still runs the previous build.
Reason: The maintainer-authored direction repairs an evidenced update failure using existing installation state and no new user option.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 5 items remain

Keep open: this maintainer-authored PR addresses a current-main update failure, but two introduced defects need repair before merge.

Priority: P1
Reviewed head: f6ff93d72e7214054a97da934347ddfb6a47be9e

Before merge

  • Decide placed-release reuse after local-commit replay (P1) - beforeCandidate also runs on the upstream SHA before worktree creation (update-runner-git-preflight.ts:576), not only after replay at line 151. If an interrupted update placed upstream commit U and the operator subsequently adds local commit L, the next implicit dev update matches U here and throws before replaying L. It activates the old U build while reporting success, silently omitting the operator's local change. Keep pre-checkout admission intact and make the reuse decision only after the final candidate tree is known; cover this through the real preflight rather than the selection mock.
  • Restore trial-upgraded state before selecting the fallback (P1) - This publishes the fallback with trial:false before checking fresh.mayHaveServed, so it clears .trial even when the candidate already started. Consider release 2.0.0 upgrading the database and crashing once, leaving attempts:1 and no live lease, followed by an update targeting fallback 1.0.0. Placement identifies 1.0.0 as serving; the already-current branch calls this function and returns skipped after selecting 1.0.0. The database remains at 2.0.0's schema, and the launcher has lost the record needed to restore its preserved database family and upgrade plans. Keeping the candidate's files does not preserve recovery. Limit the direct reconciliation to never-started trials and use the existing restoration owner before switching away from a started trial.
  • 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.
  • Explain or restore the original intent of Candidate selection and local replay - 6747b1e: Reuse the existing candidate preflight, including local-commit replay, before activating a release.
  • Explain or restore the original intent of Failed-trial fallback - 6747b1e: Restore the state replaced by a failed trial before selecting its previous release.

Findings

  • [P1] Decide placed-release reuse after local-commit replay — src/infra/update-runner-git-release.ts:284-286
  • [P1] Restore trial-upgraded state before selecting the fallback — src/infra/git-release.ts:209-215

Provenance

  • Candidate selection and local replay changes intended behavior without addressing why it exists (6747b1e: Reuse the existing candidate preflight, including local-commit replay, before activating a release.)
  • Failed-trial fallback changes intended behavior without addressing why it exists (6747b1e: Restore the state replaced by a failed trial before selecting its previous release.)

Tests

  • Missing end-to-end proof: Supply redacted shipped-CLI results for placed-target reuse and supersession, plus an upgrade from v2026.11.5 preserving settings and data; redact credentials, IPs, and non-public endpoints.
Agent review details

How this fits together

The Git updater selects and builds worktree releases, publishes the installation link and trial record, and hands activation to Gateway restart and launcher recovery.

flowchart TD
  A[Update CLI] --> B[Read release placement]
  B --> C[Select candidate and replay local commits]
  C --> D[Reuse or build release]
  D --> E[Publish link and trial]
  E --> F[Restart and verify Gateway]
  F --> G[Settle trial or restore fallback]
Loading

Technical review

Best possible solution:

Retain the placement owner, decide reuse after local replay, and preserve launcher-owned state recovery before switching away from any started trial.

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

Current-main source establishes the link-versus-serving failure, and the related PR documents a real half-switched installation; this review executed no target code.

Is this the best way to solve the issue?

Using existing trial and lease records is appropriate, but reuse must follow replay and switching back must retain the existing state-restoration boundary.

Full review comments:

  • [P1] Decide placed-release reuse after local-commit replay — src/infra/update-runner-git-release.ts:284-286
    beforeCandidate also runs on the upstream SHA before worktree creation (update-runner-git-preflight.ts:576), not only after replay at line 151. If an interrupted update placed upstream commit U and the operator subsequently adds local commit L, the next implicit dev update matches U here and throws before replaying L. It activates the old U build while reporting success, silently omitting the operator's local change. Keep pre-checkout admission intact and make the reuse decision only after the final candidate tree is known; cover this through the real preflight rather than the selection mock.
    Confidence: 0.99
  • [P1] Restore trial-upgraded state before selecting the fallback — src/infra/git-release.ts:209-215
    This publishes the fallback with trial:false before checking fresh.mayHaveServed, so it clears .trial even when the candidate already started. Consider release 2.0.0 upgrading the database and crashing once, leaving attempts:1 and no live lease, followed by an update targeting fallback 1.0.0. Placement identifies 1.0.0 as serving; the already-current branch calls this function and returns skipped after selecting 1.0.0. The database remains at 2.0.0's schema, and the launcher has lost the record needed to restore its preserved database family and upgrade plans. Keeping the candidate's files does not preserve recovery. Limit the direct reconciliation to never-started trials and use the existing restoration owner before switching away from a started trial.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Serving-release identification changes intended behavior with a stated reason (6747b1e: Find the active Git release even when the updater runs from the preserved developer checkout.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • OPENCLAW_VITEST_RUNTIME=node node scripts/run-vitest.mjs src/infra/update-runner-git-release.test.ts src/infra/git-release.test.ts src/infra/update-runner-git-candidate.test.ts src/infra/package-release-retention.test.ts
  • pnpm tsgo:core
  • pnpm tsgo:core:test
  • node scripts/run-oxlint.mjs src/infra/git-release.ts src/infra/update-runner-git-release.ts src/infra/update-runner-git-preflight.ts
  • git diff --check

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 6747b1e adds src/infra/update-runner-git-release.ts:57 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6747b1ec5ae3; files: src/infra/update-runner-git-release.ts)
  • Jason (Json): Raw commit b868ed4 adds src/infra/package-release-lease.ts:52 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b868ed4c21ba; files: src/infra/package-release-lease.ts)

PR surface

Source +232, Tests +227, Docs +31. Total +490 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 261 29 +232
Tests 1 235 8 +227
Docs 1 31 0 +31
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 527 37 +490

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.

Review metrics

Metric Value Why it matters
Production versus regression coverage Production +261/-29 lines; tests +235/-8 lines The growth implements placement reconciliation and distinct recovery cases, but mocked candidate selection misses the real replay boundary.

Labels

Label changes:

  • add P1: Interrupted Git updates can falsely report success, leave activation unfinished, and select an unsuitable fallback.
  • add merge-risk: 🚨 compatibility: The introduced paths can omit local commits from the activated build or select older code without restoring trial-upgraded state.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P1: Interrupted Git updates can falsely report success, leave activation unfinished, and select an unsuitable fallback.
  • merge-risk: 🚨 compatibility: The introduced paths can omit local commits from the activated build or select older code without restoring trial-upgraded state.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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

@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review November 19, 2026 10:16
@fuller-stack-dev
fuller-stack-dev marked this pull request as draft November 19, 2026 11:23
@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review November 19, 2026 13:31
@fuller-stack-dev
fuller-stack-dev marked this pull request as draft November 19, 2026 15:10
@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review November 19, 2026 16:23
@fuller-stack-dev
fuller-stack-dev merged commit 32d629f into openclaw:main Nov 19, 2026
133 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

@fuller-stack-dev
fuller-stack-dev deleted the fix/update-git-release-running-build-from-evidence branch November 19, 2026 18:53
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 20, 2026
openclaw#201538)

* fix(update): build on the release that serves, not on a never-served link target

* fix(update): reuse a placed release before building and keep its fallback

* fix(update): fall back only to a present, verified build of what serves

* fix(update): admit the target before reusing a placed release

* fix(update): reuse or supersede only never-started releases, after replay and checks

* fix(update): keep Git release links resolvable and trials owned by their fallback

* test(update): cover every Git release placement state, linked state dirs included

* fix(update): leave Git release repair to restarting updates and reuse only clean releases

* test(update): satisfy lint in the Git release placement cases

* fix(update): trust a Git release fallback only with evidence that it served

* test(update): drop unused results in Git release cases

* fix(update): use a Git release fallback only on evidence that its commit serves

* fix(update): refuse checkout evidence once a Gateway ran a release, and report a changed selection

* fix(update): leave a superseded Git release to collection, which keeps the running updater's own

* fix(update): require the launcher's entry in a Git release fallback

* fix(update): read served evidence from the install's own checkout

* fix(update): follow the Git release layout outside node_modules
obviyus added a commit that referenced this pull request Nov 21, 2026
…lace Git runner (#200578)

Slice 4b of the update foundation. Follows #199706 (slice 4), #201917 (releases outside `node_modules`) and #201538 (half-switched Git updates).

## Problem

Since #199706, POSIX Git checkouts with a Gateway service update through releases: a detached worktree at `<state>/git-install/releases/<id>/openclaw`, behind the link `<state>/git-install/openclaw`, started by a launcher that switches back after two failed starts. Three cases still used the in-place Git runner, which rewrites the checkout the Gateway runs from:

- Windows checkouts;
- package-to-Git switches;
- checkouts with no Gateway service.

That runner is RC1 of the update RCA: in-place replacement at a path running processes use. Keeping it meant keeping its rollback, retention, pack transfer, staging and handoff code.

## Change

Every Git install now updates through releases. The in-place Git runner and its command-side rollback are deleted on every platform in one cutover. `openclaw update` no longer moves the checkout `HEAD` or rebuilds its `dist`. (`scripts/update-gateway.sh`, a separate maintainer script, still rebuilds a checkout in place; it is unchanged.)

- **Windows:**
  - The release link is an NTFS junction, which needs no administrator rights. It is owned by the existing `package-release-slot*` code; the win32 exclusions there and in the release lease are removed.
  - Windows cannot rename onto a junction, so a switch removes the old junction and then renames.
  - The Windows task supervisor starts its Gateway child through the release launcher, so the child's starts count toward the trial.
- **Package-to-Git:**
  - The checkout is cloned and the target is built as the release on trial. Its fallback is the npm package that was serving, kept intact: if the Git build fails to start twice, the launcher switches the link back to the package, and the Gateway and `openclaw` on PATH run the npm build again with no manual step. A deferred (`--no-restart`) switch keeps the same fallback. The package counts as this install's only while its `openclaw.mjs` is exactly this install's forwarding entry; retention never touches it.
  - The global npm package's `openclaw.mjs` is rewritten once to import the release launcher, so the existing npm bin shims run the release. Without that, `openclaw` on PATH would keep running the old npm build, whose updater treats the install as npm.
  - The rejected alternative, re-pointing the npm package path at the release, would name the release through `node_modules/openclaw` again, the cause of #201874.
  - Installs whose switch was done by an older updater have the npm package path linked to the checkout, which releases never rebuild. A Git release update replaces that link (only a link to the checkout) with a directory holding `openclaw.mjs` and `dist/index.js`, both starting the launcher; the second keeps a service definition that names the package path working after a `--no-restart` update. Without this, the CLI and its updater stayed on the version the switch built (found by the package-to-Git upgrade lane).
- **No service:** a checkout run by hand updates through a release too. The next `openclaw gateway` runs it.
- **CLI on PATH:** after a Git release update, the installer's `openclaw` wrapper (POSIX and Windows) is rewritten once to run the release launcher, and a global npm, pnpm (`pnpm add -g openclaw@link:`) or Bun (`bun link`) link to the checkout is replaced the same way as the npm link above. The launcher selects a `--no-restart` release on the next Gateway run and counts `openclaw gateway` / `openclaw gateway run` as trial starts; other commands (`gateway status`, `--version`) never count.
- **Service definition:** `serviceUsesUpdatedRoot` reads the service definition, not the running process. A `--no-restart` Git release update whose service still starts the checkout writes a definition that starts the launcher without starting or restarting the Gateway (`stage`; systemd reloads unit metadata only). Every OpenClaw restart route on macOS (`openclaw gateway restart` and the Gateway's own restart) re-bootstraps the job when the loaded command is known to differ from the plist on disk; otherwise it kickstarts. Only a failed write leaves an owed `service-definition` step.
- **Conversion stop:** a Git update stops a Gateway whose service does not yet name the launcher before the release activates, so the existing install rebinds it. A Dashboard update on macOS runs inside the Gateway's LaunchAgent, which cannot rewrite itself while loaded; without the stop, the update reported success, the Gateway kept the old checkout and the result asked for `openclaw gateway install --force`. This replaces `main`'s macOS in-place fallback (247b958), whose runner this PR deletes. An update the previous definition does not start is reported as pending, not succeeded. Services that already name the launcher still switch without a stop.
- **Restart:** the converted service restarts once, not twice. Git release updates no longer warn to restart a live Gateway by hand: a release replaces no root the Gateway uses.
- **No manual steps (Ayaan, 2026-11-20):**
  - Releases built under `lib/node_modules` by `7db69bedeab6`-era updaters (#201874): bundled plugin public surfaces there load the built `dist/extensions/<plugin>/` JavaScript, so those installs update by themselves; the manual bridge in the #201874 comment is no longer needed.
  - A killed npm link swap leaves the link under npm's backup name; the next Git update restores it and retries.
  - The launcher finishes a Windows link switch killed between removing the old junction and renaming the new one.
  - npm -> Git -> npm: destination ownership recognizes this install's exact forwarding `openclaw.mjs`, so switching back is admitted.

## Impact

- One update path for Git installs on macOS, Linux and Windows.
- `openclaw` on PATH runs the current release after an update.
- **Accepted edge cases:**
  - Two checkouts that share one state directory share its single release install.
  - After a package-to-Git switch, the old npm package keeps its disk space until a switch back to npm replaces it.
  - A Gateway run for another profile through the default `openclaw` on PATH counts toward the default install's trial (accepted by Ayaan, 2026-11-20).
  - `--no-restart` selects the new release at the next start without the two-start switch-back.
  - A checkout installed at `<state>/git-install/openclaw` (the release link path; the installer default is `~/openclaw`) is left in place, and every update fails visibly with nothing changed, naming the fix: move the checkout or reinstall with another `--git-dir` (accepted by Ayaan, 2026-11-21).
  - The first update of an install whose service still names the checkout has a one-time outage while the Gateway stops and the LaunchAgent or unit is rebound (26 s on the macOS Dashboard run).
  - If a macOS release's `launchctl print` omits the job's arguments, a definition staged by `--no-restart` applies at the next login or update instead of the next restart.
  - Unchanged follow-up: when local commits conflict with every newer commit, the preflight reports `already-current` instead of naming the conflict. This predates the PR and gets its own PR.

## Size

Against the merge base, 32 commits:

- Production code: +821 / −2,166 (56 files).
- Tests: +1,391 / −8,893 (74 files). Cut tests covered steps a Git release no longer takes (checkout rollback, in-place staging, service stop before checkout); each is listed in the contract.
- Upgrade-survivor scenario: +836 / −104 (4 files): baselines `v2026.11.5`, `7db69bedeab6`, `main`; package-to-Git; no service; SIGKILL at stage, build, publish, link switch and launcher restore.
- Docs: +132 / −104.

## Evidence

Final head `99ecf23e04e8`. Each row names the head its end-to-end proof ran on; later commits change tests, the e2e helper's lint, the restart warning text, the macOS reload probe's unknown case, the npm/pnpm/Bun link lookup and the deferred-switch staging (unit-proven, red on base).

| Invariant | Result | Proof |
|---|---|---|
| Release built where it serves; no `node_modules` in the link or realpath | Pass | Linux upgrade-survivor lanes; macOS launchd (isolated profile on a maintainer Mac); hosted Crabbox Windows Server 2025 |
| Gateway serves the new release and `tools.invoke web_search` works after every update | Pass | every hop on all three OSes |
| SIGKILL at stage, build, publish, link switch, launcher restore leaves a serving install | Pass | Linux kill-point lane (`8f63330`) |
| Two failed starts switch back and restore `.pre-` state | Pass | Linux lanes; macOS `8f63330` (`failed to start twice; switched back`); Windows `9cbc4b5`, automatic through the Scheduled Task, 67.5 s outage. Older-supervisor and pending cases: unit tests red on base (`6003675`, `75e7bd5`) |
| The release updates itself | Pass | Linux; macOS `8f63330`; Windows `9cbc4b5` |
| The checkout is never written (HEAD, status) | Pass | every lane and OS run |
| Every shipped layout reaches releases with no manual step | Pass | `v2026.11.5`, merge-base `main` (`8f63330`); `7db69bedeab6` (`6003675`) |
| npm → Git switch; `openclaw` on PATH runs the release | Pass | Linux `75e7bd5` |
| No service: the next `openclaw gateway` runs the release | Pass | Linux `8f63330` |
| `--no-restart` keeps the Gateway up; the next restart runs the release | Pass | macOS `8f63330`: 0 s outage, `gateway restart` reloads launchd arguments |
| macOS Dashboard update (`update.run`) on a LaunchAgent that names the checkout, twice, then a terminal update | Pass | `80d9587`, isolated profile on a maintainer Mac: each update served its new commit, launchd runs `openclaw-launcher.mjs`, `web_search` passed, checkout unchanged, no manual step needed. Red on `3c14869` (Gateway kept the checkout, manual install step) |
| Linux `7db69bedeab6` → head and npm → Git | Pass | `80d9587` |
| Windows junction; a release held open is retained, then collected | Pass | hosted Crabbox (Windows Server 2025) |
| Windows without admin rights | Not run | S4U Limited stays admin on the Crabbox image |
| Installer-made partial clones (`--filter=blob:none`) | Not run | all lanes clone fully |

Reviews: local ClawSweeper on every head (last finding accepted above); Fable 5.2 contract reviews. Unit: release, update-runner, launcher, wrapper, service, launchd, systemd, restart, task-supervisor, plugin loader suites; `tsgo:core` and `tsgo:core:test` clean.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 22, 2026
…lace Git runner (openclaw#200578)

Slice 4b of the update foundation. Follows openclaw#199706 (slice 4), openclaw#201917 (releases outside `node_modules`) and openclaw#201538 (half-switched Git updates).

## Problem

Since openclaw#199706, POSIX Git checkouts with a Gateway service update through releases: a detached worktree at `<state>/git-install/releases/<id>/openclaw`, behind the link `<state>/git-install/openclaw`, started by a launcher that switches back after two failed starts. Three cases still used the in-place Git runner, which rewrites the checkout the Gateway runs from:

- Windows checkouts;
- package-to-Git switches;
- checkouts with no Gateway service.

That runner is RC1 of the update RCA: in-place replacement at a path running processes use. Keeping it meant keeping its rollback, retention, pack transfer, staging and handoff code.

## Change

Every Git install now updates through releases. The in-place Git runner and its command-side rollback are deleted on every platform in one cutover. `openclaw update` no longer moves the checkout `HEAD` or rebuilds its `dist`. (`scripts/update-gateway.sh`, a separate maintainer script, still rebuilds a checkout in place; it is unchanged.)

- **Windows:**
  - The release link is an NTFS junction, which needs no administrator rights. It is owned by the existing `package-release-slot*` code; the win32 exclusions there and in the release lease are removed.
  - Windows cannot rename onto a junction, so a switch removes the old junction and then renames.
  - The Windows task supervisor starts its Gateway child through the release launcher, so the child's starts count toward the trial.
- **Package-to-Git:**
  - The checkout is cloned and the target is built as the release on trial. Its fallback is the npm package that was serving, kept intact: if the Git build fails to start twice, the launcher switches the link back to the package, and the Gateway and `openclaw` on PATH run the npm build again with no manual step. A deferred (`--no-restart`) switch keeps the same fallback. The package counts as this install's only while its `openclaw.mjs` is exactly this install's forwarding entry; retention never touches it.
  - The global npm package's `openclaw.mjs` is rewritten once to import the release launcher, so the existing npm bin shims run the release. Without that, `openclaw` on PATH would keep running the old npm build, whose updater treats the install as npm.
  - The rejected alternative, re-pointing the npm package path at the release, would name the release through `node_modules/openclaw` again, the cause of openclaw#201874.
  - Installs whose switch was done by an older updater have the npm package path linked to the checkout, which releases never rebuild. A Git release update replaces that link (only a link to the checkout) with a directory holding `openclaw.mjs` and `dist/index.js`, both starting the launcher; the second keeps a service definition that names the package path working after a `--no-restart` update. Without this, the CLI and its updater stayed on the version the switch built (found by the package-to-Git upgrade lane).
- **No service:** a checkout run by hand updates through a release too. The next `openclaw gateway` runs it.
- **CLI on PATH:** after a Git release update, the installer's `openclaw` wrapper (POSIX and Windows) is rewritten once to run the release launcher, and a global npm, pnpm (`pnpm add -g openclaw@link:`) or Bun (`bun link`) link to the checkout is replaced the same way as the npm link above. The launcher selects a `--no-restart` release on the next Gateway run and counts `openclaw gateway` / `openclaw gateway run` as trial starts; other commands (`gateway status`, `--version`) never count.
- **Service definition:** `serviceUsesUpdatedRoot` reads the service definition, not the running process. A `--no-restart` Git release update whose service still starts the checkout writes a definition that starts the launcher without starting or restarting the Gateway (`stage`; systemd reloads unit metadata only). Every OpenClaw restart route on macOS (`openclaw gateway restart` and the Gateway's own restart) re-bootstraps the job when the loaded command is known to differ from the plist on disk; otherwise it kickstarts. Only a failed write leaves an owed `service-definition` step.
- **Conversion stop:** a Git update stops a Gateway whose service does not yet name the launcher before the release activates, so the existing install rebinds it. A Dashboard update on macOS runs inside the Gateway's LaunchAgent, which cannot rewrite itself while loaded; without the stop, the update reported success, the Gateway kept the old checkout and the result asked for `openclaw gateway install --force`. This replaces `main`'s macOS in-place fallback (e4b7909), whose runner this PR deletes. An update the previous definition does not start is reported as pending, not succeeded. Services that already name the launcher still switch without a stop.
- **Restart:** the converted service restarts once, not twice. Git release updates no longer warn to restart a live Gateway by hand: a release replaces no root the Gateway uses.
- **No manual steps (Ayaan, 2026-11-20):**
  - Releases built under `lib/node_modules` by `47b219778879`-era updaters (openclaw#201874): bundled plugin public surfaces there load the built `dist/extensions/<plugin>/` JavaScript, so those installs update by themselves; the manual bridge in the openclaw#201874 comment is no longer needed.
  - A killed npm link swap leaves the link under npm's backup name; the next Git update restores it and retries.
  - The launcher finishes a Windows link switch killed between removing the old junction and renaming the new one.
  - npm -> Git -> npm: destination ownership recognizes this install's exact forwarding `openclaw.mjs`, so switching back is admitted.

## Impact

- One update path for Git installs on macOS, Linux and Windows.
- `openclaw` on PATH runs the current release after an update.
- **Accepted edge cases:**
  - Two checkouts that share one state directory share its single release install.
  - After a package-to-Git switch, the old npm package keeps its disk space until a switch back to npm replaces it.
  - A Gateway run for another profile through the default `openclaw` on PATH counts toward the default install's trial (accepted by Ayaan, 2026-11-20).
  - `--no-restart` selects the new release at the next start without the two-start switch-back.
  - A checkout installed at `<state>/git-install/openclaw` (the release link path; the installer default is `~/openclaw`) is left in place, and every update fails visibly with nothing changed, naming the fix: move the checkout or reinstall with another `--git-dir` (accepted by Ayaan, 2026-11-21).
  - The first update of an install whose service still names the checkout has a one-time outage while the Gateway stops and the LaunchAgent or unit is rebound (26 s on the macOS Dashboard run).
  - If a macOS release's `launchctl print` omits the job's arguments, a definition staged by `--no-restart` applies at the next login or update instead of the next restart.
  - Unchanged follow-up: when local commits conflict with every newer commit, the preflight reports `already-current` instead of naming the conflict. This predates the PR and gets its own PR.

## Size

Against the merge base, 32 commits:

- Production code: +821 / −2,166 (56 files).
- Tests: +1,391 / −8,893 (74 files). Cut tests covered steps a Git release no longer takes (checkout rollback, in-place staging, service stop before checkout); each is listed in the contract.
- Upgrade-survivor scenario: +836 / −104 (4 files): baselines `v2026.11.5`, `47b219778879`, `main`; package-to-Git; no service; SIGKILL at stage, build, publish, link switch and launcher restore.
- Docs: +132 / −104.

## Evidence

Final head `99ecf23e04e8`. Each row names the head its end-to-end proof ran on; later commits change tests, the e2e helper's lint, the restart warning text, the macOS reload probe's unknown case, the npm/pnpm/Bun link lookup and the deferred-switch staging (unit-proven, red on base).

| Invariant | Result | Proof |
|---|---|---|
| Release built where it serves; no `node_modules` in the link or realpath | Pass | Linux upgrade-survivor lanes; macOS launchd (isolated profile on a maintainer Mac); hosted Crabbox Windows Server 2025 |
| Gateway serves the new release and `tools.invoke web_search` works after every update | Pass | every hop on all three OSes |
| SIGKILL at stage, build, publish, link switch, launcher restore leaves a serving install | Pass | Linux kill-point lane (`8f63330`) |
| Two failed starts switch back and restore `.pre-` state | Pass | Linux lanes; macOS `8f63330` (`failed to start twice; switched back`); Windows `9cbc4b5`, automatic through the Scheduled Task, 67.5 s outage. Older-supervisor and pending cases: unit tests red on base (`6003675`, `75e7bd5`) |
| The release updates itself | Pass | Linux; macOS `8f63330`; Windows `9cbc4b5` |
| The checkout is never written (HEAD, status) | Pass | every lane and OS run |
| Every shipped layout reaches releases with no manual step | Pass | `v2026.11.5`, merge-base `main` (`8f63330`); `47b219778879` (`6003675`) |
| npm → Git switch; `openclaw` on PATH runs the release | Pass | Linux `75e7bd5` |
| No service: the next `openclaw gateway` runs the release | Pass | Linux `8f63330` |
| `--no-restart` keeps the Gateway up; the next restart runs the release | Pass | macOS `8f63330`: 0 s outage, `gateway restart` reloads launchd arguments |
| macOS Dashboard update (`update.run`) on a LaunchAgent that names the checkout, twice, then a terminal update | Pass | `80d9587`, isolated profile on a maintainer Mac: each update served its new commit, launchd runs `openclaw-launcher.mjs`, `web_search` passed, checkout unchanged, no manual step needed. Red on `3c14869` (Gateway kept the checkout, manual install step) |
| Linux `47b219778879` → head and npm → Git | Pass | `80d9587` |
| Windows junction; a release held open is retained, then collected | Pass | hosted Crabbox (Windows Server 2025) |
| Windows without admin rights | Not run | S4U Limited stays admin on the Crabbox image |
| Installer-made partial clones (`--filter=blob:none`) | Not run | all lanes clone fully |

Reviews: local ClawSweeper on every head (last finding accepted above); Fable 5.2 contract reviews. Unit: release, update-runner, launcher, wrapper, service, launchd, systemd, restart, task-supervisor, plugin loader suites; `tsgo:core` and `tsgo:core:test` clean.

Co-authored-by: Ayaan Zaidi <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
…lace Git runner (#200578)

Slice 4b of the update foundation. Follows #199706 (slice 4), #201917 (releases outside `node_modules`) and #201538 (half-switched Git updates).

## Problem

Since #199706, POSIX Git checkouts with a Gateway service update through releases: a detached worktree at `<state>/git-install/releases/<id>/openclaw`, behind the link `<state>/git-install/openclaw`, started by a launcher that switches back after two failed starts. Three cases still used the in-place Git runner, which rewrites the checkout the Gateway runs from:

- Windows checkouts;
- package-to-Git switches;
- checkouts with no Gateway service.

That runner is RC1 of the update RCA: in-place replacement at a path running processes use. Keeping it meant keeping its rollback, retention, pack transfer, staging and handoff code.

## Change

Every Git install now updates through releases. The in-place Git runner and its command-side rollback are deleted on every platform in one cutover. `openclaw update` no longer moves the checkout `HEAD` or rebuilds its `dist`. (`scripts/update-gateway.sh`, a separate maintainer script, still rebuilds a checkout in place; it is unchanged.)

- **Windows:**
  - The release link is an NTFS junction, which needs no administrator rights. It is owned by the existing `package-release-slot*` code; the win32 exclusions there and in the release lease are removed.
  - Windows cannot rename onto a junction, so a switch removes the old junction and then renames.
  - The Windows task supervisor starts its Gateway child through the release launcher, so the child's starts count toward the trial.
- **Package-to-Git:**
  - The checkout is cloned and the target is built as the release on trial. Its fallback is the npm package that was serving, kept intact: if the Git build fails to start twice, the launcher switches the link back to the package, and the Gateway and `openclaw` on PATH run the npm build again with no manual step. A deferred (`--no-restart`) switch keeps the same fallback. The package counts as this install's only while its `openclaw.mjs` is exactly this install's forwarding entry; retention never touches it.
  - The global npm package's `openclaw.mjs` is rewritten once to import the release launcher, so the existing npm bin shims run the release. Without that, `openclaw` on PATH would keep running the old npm build, whose updater treats the install as npm.
  - The rejected alternative, re-pointing the npm package path at the release, would name the release through `node_modules/openclaw` again, the cause of #201874.
  - Installs whose switch was done by an older updater have the npm package path linked to the checkout, which releases never rebuild. A Git release update replaces that link (only a link to the checkout) with a directory holding `openclaw.mjs` and `dist/index.js`, both starting the launcher; the second keeps a service definition that names the package path working after a `--no-restart` update. Without this, the CLI and its updater stayed on the version the switch built (found by the package-to-Git upgrade lane).
- **No service:** a checkout run by hand updates through a release too. The next `openclaw gateway` runs it.
- **CLI on PATH:** after a Git release update, the installer's `openclaw` wrapper (POSIX and Windows) is rewritten once to run the release launcher, and a global npm, pnpm (`pnpm add -g openclaw@link:`) or Bun (`bun link`) link to the checkout is replaced the same way as the npm link above. The launcher selects a `--no-restart` release on the next Gateway run and counts `openclaw gateway` / `openclaw gateway run` as trial starts; other commands (`gateway status`, `--version`) never count.
- **Service definition:** `serviceUsesUpdatedRoot` reads the service definition, not the running process. A `--no-restart` Git release update whose service still starts the checkout writes a definition that starts the launcher without starting or restarting the Gateway (`stage`; systemd reloads unit metadata only). Every OpenClaw restart route on macOS (`openclaw gateway restart` and the Gateway's own restart) re-bootstraps the job when the loaded command is known to differ from the plist on disk; otherwise it kickstarts. Only a failed write leaves an owed `service-definition` step.
- **Conversion stop:** a Git update stops a Gateway whose service does not yet name the launcher before the release activates, so the existing install rebinds it. A Dashboard update on macOS runs inside the Gateway's LaunchAgent, which cannot rewrite itself while loaded; without the stop, the update reported success, the Gateway kept the old checkout and the result asked for `openclaw gateway install --force`. This replaces `main`'s macOS in-place fallback (247b958), whose runner this PR deletes. An update the previous definition does not start is reported as pending, not succeeded. Services that already name the launcher still switch without a stop.
- **Restart:** the converted service restarts once, not twice. Git release updates no longer warn to restart a live Gateway by hand: a release replaces no root the Gateway uses.
- **No manual steps (Ayaan, 2026-11-20):**
  - Releases built under `lib/node_modules` by `7db69bedeab6`-era updaters (#201874): bundled plugin public surfaces there load the built `dist/extensions/<plugin>/` JavaScript, so those installs update by themselves; the manual bridge in the #201874 comment is no longer needed.
  - A killed npm link swap leaves the link under npm's backup name; the next Git update restores it and retries.
  - The launcher finishes a Windows link switch killed between removing the old junction and renaming the new one.
  - npm -> Git -> npm: destination ownership recognizes this install's exact forwarding `openclaw.mjs`, so switching back is admitted.

## Impact

- One update path for Git installs on macOS, Linux and Windows.
- `openclaw` on PATH runs the current release after an update.
- **Accepted edge cases:**
  - Two checkouts that share one state directory share its single release install.
  - After a package-to-Git switch, the old npm package keeps its disk space until a switch back to npm replaces it.
  - A Gateway run for another profile through the default `openclaw` on PATH counts toward the default install's trial (accepted by Ayaan, 2026-11-20).
  - `--no-restart` selects the new release at the next start without the two-start switch-back.
  - A checkout installed at `<state>/git-install/openclaw` (the release link path; the installer default is `~/openclaw`) is left in place, and every update fails visibly with nothing changed, naming the fix: move the checkout or reinstall with another `--git-dir` (accepted by Ayaan, 2026-11-21).
  - The first update of an install whose service still names the checkout has a one-time outage while the Gateway stops and the LaunchAgent or unit is rebound (26 s on the macOS Dashboard run).
  - If a macOS release's `launchctl print` omits the job's arguments, a definition staged by `--no-restart` applies at the next login or update instead of the next restart.
  - Unchanged follow-up: when local commits conflict with every newer commit, the preflight reports `already-current` instead of naming the conflict. This predates the PR and gets its own PR.

## Size

Against the merge base, 32 commits:

- Production code: +821 / −2,166 (56 files).
- Tests: +1,391 / −8,893 (74 files). Cut tests covered steps a Git release no longer takes (checkout rollback, in-place staging, service stop before checkout); each is listed in the contract.
- Upgrade-survivor scenario: +836 / −104 (4 files): baselines `v2026.11.5`, `7db69bedeab6`, `main`; package-to-Git; no service; SIGKILL at stage, build, publish, link switch and launcher restore.
- Docs: +132 / −104.

## Evidence

Final head `99ecf23e04e8`. Each row names the head its end-to-end proof ran on; later commits change tests, the e2e helper's lint, the restart warning text, the macOS reload probe's unknown case, the npm/pnpm/Bun link lookup and the deferred-switch staging (unit-proven, red on base).

| Invariant | Result | Proof |
|---|---|---|
| Release built where it serves; no `node_modules` in the link or realpath | Pass | Linux upgrade-survivor lanes; macOS launchd (isolated profile on a maintainer Mac); hosted Crabbox Windows Server 2025 |
| Gateway serves the new release and `tools.invoke web_search` works after every update | Pass | every hop on all three OSes |
| SIGKILL at stage, build, publish, link switch, launcher restore leaves a serving install | Pass | Linux kill-point lane (`8f63330`) |
| Two failed starts switch back and restore `.pre-` state | Pass | Linux lanes; macOS `8f63330` (`failed to start twice; switched back`); Windows `9cbc4b5`, automatic through the Scheduled Task, 67.5 s outage. Older-supervisor and pending cases: unit tests red on base (`6003675`, `75e7bd5`) |
| The release updates itself | Pass | Linux; macOS `8f63330`; Windows `9cbc4b5` |
| The checkout is never written (HEAD, status) | Pass | every lane and OS run |
| Every shipped layout reaches releases with no manual step | Pass | `v2026.11.5`, merge-base `main` (`8f63330`); `7db69bedeab6` (`6003675`) |
| npm → Git switch; `openclaw` on PATH runs the release | Pass | Linux `75e7bd5` |
| No service: the next `openclaw gateway` runs the release | Pass | Linux `8f63330` |
| `--no-restart` keeps the Gateway up; the next restart runs the release | Pass | macOS `8f63330`: 0 s outage, `gateway restart` reloads launchd arguments |
| macOS Dashboard update (`update.run`) on a LaunchAgent that names the checkout, twice, then a terminal update | Pass | `80d9587`, isolated profile on a maintainer Mac: each update served its new commit, launchd runs `openclaw-launcher.mjs`, `web_search` passed, checkout unchanged, no manual step needed. Red on `3c14869` (Gateway kept the checkout, manual install step) |
| Linux `7db69bedeab6` → head and npm → Git | Pass | `80d9587` |
| Windows junction; a release held open is retained, then collected | Pass | hosted Crabbox (Windows Server 2025) |
| Windows without admin rights | Not run | S4U Limited stays admin on the Crabbox image |
| Installer-made partial clones (`--filter=blob:none`) | Not run | all lanes clone fully |

Reviews: local ClawSweeper on every head (last finding accepted above); Fable 5.2 contract reviews. Unit: release, update-runner, launcher, wrapper, service, launchd, systemd, restart, task-supervisor, plugin loader suites; `tsgo:core` and `tsgo:core:test` clean.

Co-authored-by: Ayaan Zaidi <[email protected]>

(cherry picked from commit b229b26)

Release adaptation: Extract only the three public-surface resolver, caller and regression paths. Preserve globals, source checkouts and already-bound plugin instances; exclude the Git updater rewrite.

Companion audit: PR #200578 is the source; #203247 and #204835 follow the excluded Windows launcher and install switch. No follow-up modifies the selected public-surface files.

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

docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant