Repository navigation
fix: finish a half-switched Git update instead of reporting it current - #201538
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. What this changesThis 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.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenancePossible 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 Before merge
Findings
Provenance
Tests
Agent review detailsHow this fits togetherThe 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]
Technical reviewBest 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:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d6f628897ad7. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +232, Tests +227, Docs +31. Total +490 across 4 files. Added test files: 0. View PR surface stats
Preflight sourceSource 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
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 18, 2026, 7:33 PM ET / November 19, 2026, 00:33 UTC. |
…e-running-build-from-evidence
…e-running-build-from-evidence
…e-running-build-from-evidence
…e-running-build-from-evidence
…e-running-build-from-evidence
…e-running-build-from-evidence
…e-running-build-from-evidence
…e-running-build-from-evidence
…nd report a changed selection
…e-running-build-from-evidence
…s the running updater's own
…e-running-build-from-evidence
…e-running-build-from-evidence # Conflicts: # src/infra/git-release.ts # src/infra/update-runner-git-release.test.ts # src/infra/update-runner-git-release.ts
…e-running-build-from-evidence
|
Merged via squash.
|
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
…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]>
…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]>
…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]>
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 updatethen 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 updaterepairs 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), andpublishGitReleaserecorded whatever the link named as the trial'sprevious. 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 withattempts: 0. The trial record'spreviousis the release that served.Competing hypothesis: the false
already-currentcame from the tree comparison or frombeforeRuntimeVerified. 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', trialprevious= 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:
readGitReleasePlacementinsrc/infra/git-release.tsreads 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: 0and 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 useserving, 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,
supersedeUnservedGitReleaserereads 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: anopenclawstarted 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 isgit-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-placementnote 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:
src/infra/update-runner-git-release.test.tsholds 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.git-release.test.tsalready-current, nothing changes.releases/.leases/, and A's commit is the checkout's built commit (the only served evidence on disk)git-release-fallback-unavailable, not safe to restart,openclaw triage. No rebuild.already-current.git-release-selection-changed, notalready-current.--no-restartgit-release-fallback-unavailable, not safe to restart,openclaw triage.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.previousis that build. In a conversion leftover, the Gateway still runs the plain checkout through the old service definition, andpreviousis the first release built from the commit the checkout'sdistserves.previousserves: 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 underreleases/.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 owndist/build-info.jsonreportsprevious'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.previouspresent 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.previousgone, or no longer readable as a Git release: the runner has no record of the serving commit. The checkout'sdistis not proof that the service runs it. So the update switches nothing and ends as a retryable failure,git-release-fallback-unavailable, withserviceRestartSafe: false. The message says the Gateway keeps serving, not to restart it into the release link, and to runopenclaw triageso an agent can rebuild a fallback from the serving commit.This fix is also what lets an install leave the state that shipped
8f80fe08updaters 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.tshas 33 cases at the head, and every rating or landing finding's case fails with the production files of the round that raised it.--no-restartleftover is deselected when superseded;previous;End to end, through the real
openclaw updateon 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:t1andt2change only a docs file;t2badmakesstartGatewayServerCorethrow at start, standing in for the observed out-of-disk boot refusal.The installed updater is the checkout's own build: base
3eee09d9b462or8c5eae462c7for RED, the PR head006574e776e6for GREEN.The leftover is made by a real first update to
t1, killed the momentreleases/.trialappears. The result is the incident's shape:t1release, which never started;.trialis armed (attempts: 0) with the first release asprevious;Each cell runs one plain
openclaw update --channel dev --yesfrom that leftover. Downtime is the Gateway port polled every 0.5 s.t1skipped: already-current, exit 0, after a full duplicate build. The Gateway still serves the old checkout build.t2t1; targett28c5eae462c7source-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).t1t1, the trial is settled. Exit 0.t2bad, fails both startst1stays for collection, andt2badgoes on trial → fallback. It fails twice and the launcher switches back. The Gateway serves the fallback release of006574e7(working), the link names it, and no trial is left. Exit 1build-id-mismatch.t2badt1stays for collection.t2badfails twice and the launcher switches back to the rebuilt release (working Gateway, build006574e7). Exit 1build-id-mismatch.source-artifact-ownership); the updater's release stays.The superseded
t1release 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 at288d4f6f1e2f; this round changes no link writes.None of the cells hit the false
post-update-failedfixed 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 head153c8aa733df:t1: reused without a build, the Gateway servest1, trial settled. Exit 0, 164 s, 16.7 s downtime, 2 releases.t2bad: link back on the fallback, never-startedt1kept for collection,t2badfails twice, the launcher switches back to the fallback release (releases/<id>/openclaw), which serves (build153c8aa733df). Exit 1build-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: passnode scripts/run-oxlint.mjson the touched files: passpnpm 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: passPostgreSQL conformance (1/4)failure on the first head wasserver-database-engine-cron.postgres.test.tsfailing 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: cleanTest file audited in full:
src/infra/update-runner-git-release.test.ts.beforeCandidatebefore building as the real preflight does, and registers the real preflight's cleanup.Independent review: a fresh read-only reviewer (Opus) checked the diff against the behavior contract. Fixed:
--no-restartand missing-fallback messages are accurate;ClawSweeper rating, round 1 (at
6917f1fb32f5): overall F / proof C / patch F. Everysrc/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.validateCandidate. Asserted in the reuse test.git-root-unresolved. It now refuses withgit-release-fallback-unavailable. Test: "changes nothing and refuses when the fallback lost its Git metadata".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 thebb046699b91dproduction files and passes at the head./tmp, the link text was computed from/tmpbut 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".6917f1fb32f5), where that move happened early.ClawSweeper rating, round 2 (my run, at
9ce59465731819c): overall F / proof C / patch F.--no-restartwith a leftover moved the link. That would make a launcher-backed Gateway restart, and it consumed the pending release. Under--no-restartthe update now does no repair at all and says so (row 7b).database.familiesadmission needs. The serving release now goes throughvalidateCandidatefirst (row 5).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.--no-restartreplaced the armed trial. It now behaves exactly as before this change and keeps the trial (row 7b).git statusread as clean. Reuse now requires exit 0 (row 3d).collectGitReleasespassed the unresolved prefix. Under a symlinked state directory, the shared collector then did nothing. It now uses the link's resolved prefix.The three fixed findings each have a regression test that fails with the round-3 production files and passes at the head.
autoreviewdoes 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 inreadGitReleasePlacement: a fallback is used, or its commit rebuilt, only when the checkout's built commit equals the fallback's commit. OtherwiseunsafeFallback.reasonisunproven, no commit is offered, and the runner refuses before any build or switch. The--no-restartadvisory no longer promises a later repair. Tests:The two new refusal rows fail with the
2d4a72ab545production 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.diststays 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 underreleases/.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 withgit-release-fallback-unavailableinstead of guessing. Test: "changes nothing and refuses when the fallback is incomplete and a Gateway took a release lease" (row 3e).already-currentafter 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 withgit-release-selection-changedand leaves the link and trial alone (row 5a).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.supersedeUnservedGitReleaseremoved the never-started release B once the link left it, andupdate-command.tskeeps no copy of a Git release updater because "a Git release update never rewrites the tree this updater runs from".8c5eae462c7): conversion leftover (link on never-started t1 release B, trial B → A, service still on the checkout), thenopenclaw update --channel dev --yesstarted through the release link, so the updater ran from B (OpenClaw 2026.11.5 (2caf798)), targett2. The run stopped in validation withsource-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, andadmitSourceUpdateArtifacts(B)fails before mutation. In a converted install (service on the launcher), a never-started B withattempts: 0and a fallback that counts as served needs no lease directory underreleases/.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.collectGitReleases, the shared collector, which also keeps the release the running updater executes from (resolveOpenClawPackageRootSyncon 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.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.serviceRestartSafe: truewith no safe fallback: fixed. When the placement has an unsafe fallback, the runner's recovery verdict isserviceRestartSafe: falsefrom the start. Trace on the base: the only consumer that restarts ontrueismaybeRestartServiceAfterFailedMutableUpdate(viaupdate-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 expectserviceRestartSafe: false.publishGitReleaseswitching the link to the target and arming its trial (normal switch point)supersedeUnservedGitRelease: link back to the fallback, stale trial cleared (B deselected, not deleted)attempts: 0and no live lease, or nothing is touched (git-release-selection-changedon the serving-target path). The Gateway serves the fallback the link now names. B's files stay.collectGitReleases(the only deletion of releases)publishGitReleasewithtrial: false,settleGitReleaseTrial)git worktree pruneClawSweeper rating, round 5 (my run, at
961840de1bbd): overall F / proof C / patch F.dist/index.js, which the runtime verification did not check.verifiesAsGitReleasenow 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 on961840de1bbd).Landing round 4 (at
006574e776e6). All four findings were real; each has a test that fails with the006574e776e6production files and passes at the head.isCheckoutServingCommitderived "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".verifiesAsGitReleasenow requiresdist/index.jsto 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-changedcarried the old restart verdict. It now reportsserviceRestartSafe: 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".mainwith fix(update): build and serve Git releases outside node_modules #201917, which moved Git releases out oflib/node_modules(git-install/openclaw -> releases/<id>/openclaw). The release ID, the earlier-rebuild lookup and the rebuilt-release removal now usepackageReleasePrefixOfRoot, so they work for both layouts. A leftover still under the earlierlib/node_moduleslink 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.Follow-ups
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.lib/node_moduleslink (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 updatestarted through the release link during a conversion leftover stops in validation withsource-artifact-ownershipand a type-stripping error. Nothing changes, but the message does not say what to do. Running it from the checkout works.attempts: 1) and owns the trial. A leftover withattempts: 0there needs the Gateway to stay down, which the serving-evidence follow-up handles.--no-restartwith 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.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.