Skip to content

fix(update): keep openclaw runnable when a pnpm or Bun update is killed while replacing the package - #200366

Merged
fuller-stack-dev merged 6 commits into
openclaw:mainfrom
fuller-stack-dev:fix/update-plain-swap-atomic-publish
Nov 17, 2026
Merged

fuller-stack-dev merged 6 commits into
openclaw:mainfrom
fuller-stack-dev:fix/update-plain-swap-atomic-publish

Conversation

@fuller-stack-dev

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

Copy link
Copy Markdown
Member

Related: #200273

What Problem This Solves

If an update is killed (SIGKILL, power loss) while it replaces the installed package, openclaw can be left with no package at all and no longer starts. This fixes that for pnpm and Bun installations, and for npm installations whose update runs without a package-publication journal.

That swap moved the installed package to a backup name, preserved or replayed local dist edits, and only then moved the new package into place. The package path did not exist for that whole stretch. No journal records this swap, and openclaw update repair cannot run without a package.

Not fixed here. Most npm updates on macOS and Linux publish through the package-publication journal, which has the same missing-path window between its two moves. That path is unchanged. "The journaled path" below says why and lists the options.

User Impact

User impact: on macOS, and on Linux with a system perl (x64, arm64) or Node 26, these swaps publish with one atomic exchange. The package path names a complete package at every instant, also when the updater is killed, and nothing needs manual recovery.

This covers pnpm and Bun global projects, and npm when the journal is not used: --reapply-local-overrides, a release replaced in place behind its package link, a target without delegated post-core execution, or an update with no executor fence.

Where the exchange is unavailable (no tool, a filesystem that refuses the call, a stage on another filesystem) the update installs with the previous two moves. The package-swap step text says which method ran: replaced openclaw; published by an atomic exchange (perl) or ...; published by two moves (atomic exchange unavailable: <reason>).

Behavior changes to know about:

  • Local dist edits are captured from the old package at its path immediately before publication, instead of after the old package moved to its backup. This holds on macOS and Linux for every swap without a journal, including the two-move fallback, where it shortens the missing-path window to the two moves themselves. Capture still follows service drain.
  • An updater killed just before the exchange leaves the new, unpublished package under .openclaw.package-backup-<pid>-<time> beside the old package, which keeps serving. A later verified in-place swap removes it with the other historical backups.
  • One new way to fail: if the exchange is unavailable and the rename that returns the staged package to its stage then fails, the update fails with the installed package untouched and names where the staged package is. The forward rename has just succeeded, so I do not expect this in practice.

Windows, FreeBSD, and npm package links to a checkout are untouched. No config, schema, protocol, journal or dependency changes.

Update behavior. The installed version's updater performs the swap, not the candidate's. An installation on a published updater that updates to a build with this change gets the published updater's swap, as before. The first update that such a build runs itself uses the exchange. The change adds no marker and no state. The one new leftover is the backup-named directory above, which any updater treats like every other historical package backup.

Why This Change Was Made

POSIX rename cannot replace a non-empty directory, so two moves always leave a window. exchangePaths from #200273 closes it with one call (renameat2(RENAME_EXCHANGE) on Linux, renamex_np(RENAME_SWAP) on macOS).

The staged package first takes the backup name beside the package path. One exchange then leaves the new package on the package path and the old one under the backup name: the same two names the backup and activation moves produce. Nothing has to follow the exchange, so rollback, retirement, the transaction and the launcher steps are unchanged, and no step after publication can fail and strand the old package. That is why the candidate takes the backup name first, instead of exchanging stage and package path and moving the old package afterwards.

Local override capture and replay move before publication, because the old package no longer moves first. The replay helper then runs from the installed package at its own path.

package-update-swap.ts sits at the 700-line lint limit, so the unjournaled publication moved into a new module, package-update-swap-publish.ts (165 lines). It holds the two-move sequence unchanged and the exchange in front of it. The swap itself grows by 7 lines.

Kill states, and how existing readers treat them

Unjournaled swap with the exchange. backup is .openclaw.package-backup-<pid>-<time> beside the package path.

Killed after Package path backup Stage What a later run sees
launcher backup, override capture old absent new Unchanged from today before the swap.
staged package took the backup name old new empty New state. The old package serves. A later verified in-place swap removes backup as a historical backup (tested).
exchange tool started, not confirmed old or new the other empty The call is atomic: the row above or the row below.
exchange new old empty Today's state after the activation move.
launcher steps new old empty Unchanged from today.

Fallback on macOS and Linux when the exchange is unavailable: the candidate returns to the stage (the first row again), then the old package moves to backup (package path missing, old intact under backup, new in the stage), then the new package moves into place. That is today's window minus the override work.

  • Activation journal, its recovery and openclaw update repair. This path runs only when no journal was prepared. No record exists, so admission, repair and the sealed helper have nothing to interpret, and no record needs a change.
  • Rollback closures. Before the exchange nothing is registered and nothing has moved. After it the old package is under backup and the new one on the package path, the state restoreNpmPackageRoot and the native restore already handle. Rollback itself still uses two moves.
  • Historical backup retirement removes a leftover backup after a later verified in-place swap, whatever it holds. A release switch does not retire historical backups, so on an OpenClaw-owned prefix the leftover stays inside the release it was left in.
  • The npm destination gate from fix(update): retrying an update from a dev checkout is refused after a killed update #198673 acts only on an empty package path and only on a link, so it ignores the leftover directory.
  • Stage cleanup finds no package root in the stage, as after any activation.

Two outcomes that are not a clean exchange get explicit handling. If ownership is lost after the candidate took the backup name, nothing more moves and a warning names where the candidate is. If another writer leaves the two paths in neither state, the swap claims nothing: rollback reports the installation as unverified and completion retires nothing.

Variant Window before After this change
npm directory, no journal yes, including override work closed with the exchange; two moves otherwise
pnpm, Bun (native) yes, the whole global project is missing closed with the exchange; two moves otherwise
npm with a journal yes, between displacement and publication unchanged
npm package link to a checkout (rootLink) yes; the next update from the checkout restores the link (#198673) unchanged
staged package that is a link to a checkout yes unchanged
Windows, FreeBSD yes unchanged; no exchange is attempted

The package link keeps two moves because its lifecycle proves ownership on the moved entry and refuses without touching the package path. An exchange would publish before that proof.

The journaled path

A journaled npm update moves the old package to <anchor>/previous, then moves <anchor>/candidate onto the package path. The journal records each generation under a fixed name, and every reader throws Package publication object changed or generation roles are ambiguous when a name holds the other generation. Publication permutes those three names cyclically, so any single exchange leaves one of them holding the wrong generation for one state. The schema would not have to change, but the recovery interpretation would, and helpers and CLIs sealed before such a change would refuse that state. I stopped there, because the journal is the most recovery-critical owner in the updater.

Options, for a maintainer decision:

  1. Leave it (this PR). The managed update helper, when it survives, or the printed recovery command finishes a killed journaled publication.
  2. Teach the journal owner an exchange publication in its own PR: no schema change, one new durable state, and every recovery, settlement and remount reader has to learn it.
  3. Skip the journal where the exchange is available. Smallest code, but it drops standalone publication repair for most npm updates.

Evidence

What was checked. A real package swap runs in a child process once to the end, then once per boundary with the child SIGKILLed right after that boundary. A boundary is one completed filesystem mutation or the start or end of one exchange tool. After each kill the package path must serve a complete package.

  • Before the fix, 6 of 16 boundaries leave no package: the backup rename and all five steps of preserving local dist files. The next boundary publishes.
  • After the fix, none of the 17 boundaries does. The old package serves until the exchange tool has ended, and the new one from then on. The override capture finishes before the candidate moves, and the recovery bundle holds the old package's files.
  • With every exchange tool failing to start, the swap takes the two moves (20 boundaries) and the same sweep finds exactly one boundary without a package, the backup rename. The test then restores the installation by renaming the backup back. This is also the negative control: the sweep fails for a publication that backs up before it publishes.
  • Rollback after a failed verification restores the previous package, its files and its launcher on both methods, and leaves neither backup nor rejected candidate behind.
  • A swap killed with the candidate under the backup name still serves the old package, and a later verified swap removes the leftover.
  • pnpm: the whole global project is exchanged, the step names the exchange, and rollback restores the previous project.

Docker, Linux. published-driver-release-in-place (published 2026.10.9, then the candidate's own updater replaces a release in place, which runs without a journal). Image node:24.22.1-trixie-slim, aarch64, perl 5.40.1.

  • As committed, on 8b2ce35c5b5: PASS published 2026.10.9 → candidate 2026.11.4 (8b2ce35c5b5...). The candidate's package-swap step reads replaced openclaw; published by an atomic exchange (perl). The cell now asserts that text.
  • The published 2026.10.9 updater's own step in the same run reads replaced openclaw and prints a Package publication recovery: command: that update is journaled, and this change cannot alter it.
  • An earlier run on a base before fix(sessions): shipped updaters refuse the next release because the transcript worker re-emits the Gateway graph #200321 stopped at Installed candidate tree exceeds the release budget (52228 entries). With that one assertion bypassed in a local, uncommitted edit it passed with the same step text. The bypass is not in this PR, and the run above did not need it.
Commands, counts and checks

Red, then green. Command: node scripts/run-vitest.mjs run src/infra/package-update-release-switch.process.test.ts src/infra/package-update-swap.test.ts src/infra/package-update-swap.forward-authority.test.ts --maxWorkers=1

  • First reproduction, production code untouched at base 51ceecd7aeb, with the first version of the sweep: 4 failed, 6 passed. The sweep names the six boundaries above.
  • Final tests with package-update-swap.ts and package-update-local-overrides.ts from base: 10 failed, 26 passed.
  • Head: 36 passed on Node 26.12.1 (route node:ffi), macOS 27.2 arm64. With Node 24.22.1 first on PATH, those files plus path-exchange.test.ts: 40 passed, and the fixture run directly on that Node reports published by an atomic exchange (osascript).
  • On b0f1596dd94, those files plus path-exchange.test.ts, package-update-swap.windows.test.ts and package-update-steps.native-transaction.test.ts: 6 files, 65 passed.

Affected tests: every src/infra/package-update-*, package-release-*, package-local-overrides* and path-exchange test, plus every test that imports the swap or its fixtures, directly or through a shared fixture: 134 files.

  • Infra project on a08d6c94d0f, the same change before main was merged in: 84 files, 1290 passed, 11 skipped, 2 failed. Both failures are update-command-database-rollback.test.ts cases that hit the 120 s test timeout while 84 files ran in parallel. Run alone, that file passes 18 of 18, and its package case takes 28.5 s here against 28.2 s with the swap from main.
  • The other 50 files all passed: 8 unit and tooling files on a08d6c94d0f (58 passed), and 42 daemon, CLI and commands files on 8b2ce35c5b5 (682 passed, 8 skipped).
  • update-command-handoff.test.ts is excluded from those lists: 3 of its 14 tests fail on this machine with Fixture handoff escaped its private lease database, identically with the swap from main.

main was merged in three times while this ran. Those merges touch none of the changed files, the swap, its callers or its fixtures.

Checks on b0f1596dd94: oxfmt --check and node scripts/run-oxlint.mjs on the changed files, pnpm tsgo:all, pnpm check:test-lines-ratchet (+364 net test lines, allowance 400), pnpm check:test-mock-exports, pnpm format:docs:check. On 8b2ce35c5b5: OPENCLAW_CHECK_CHANGED_SKIP_DEADCODE=1 node scripts/check-changed.mjs, and before it docs:check-links and docs:check-mdx. The dead-export scan exits 1 with two entries, in extensions/slack and ui. Neither is touched here.

On the pushed head 37922d1585c, which adds two unrelated commits from main: git diff --check and node --import ./scripts/tsx.mjs scripts/check-session-identity-ratchet.mts --base origin/main --no-merge-base (Session identity ratchet OK: 1673 files, 6584 grandfathered pins). The diff adds no identity comparison and none of the counted phrases.

CI on 37922d1585c failed one job, checks-node-compact-small-2: test/scripts/update-restart-module-outcome.test.ts > retains package backups after unverified post-swap module failures, with Unexpected package dependency. Its fixture scripts/tests/update-restart-swap-fixture.mjs names every production module it runs and rejects any other import, and it did not name package-update-swap-publish. The follow-up commit test(update): load the swap publication module in the restart swap fixture adds the module. The fixture's context reports a fixed linux platform whatever the host is, so it sets supportsPathExchange to false: it keeps exercising the two moves, which is what it tested before, and can never make a host exchange call under a platform that is not the host's. Red without the fixture change and green with it, same command: node scripts/run-vitest.mjs test/scripts/update-restart-module-outcome.test.ts. Also run on that commit: test/scripts/ci-changed-node-test-plan.source-owners.test.ts and test/scripts/eager-import-closure.test.ts (2 files, 100 passed), oxfmt --check, run-oxlint.mjs, and the session identity ratchet (OK). The fixture file was read in full; nothing was removed.

Test audit. Files read in full: package-update-release-switch.process.test.ts, its child fixture package-update-release-switch.process.test-support.ts, package-update-release-switch.test-support.ts, package-update-swap.test.ts, package-update-swap.forward-authority.test.ts, package-update-swap.windows.test.ts, package-update-swap.assertions.test-support.ts, package-update-steps.native-transaction.test.ts, update-command-terminal-outcome.test.ts, update-command-mutable-signals-compensation.test-support.ts.

  • Nothing was deleted or weakened, and no timeout or retry was added.
  • Existing cases that inject a fault into the two-move sequence (a denied backup rename, the Windows rename retries, a signal between the moves) would no longer reach that sequence on macOS and Linux, so they now select it: publishWithoutPathExchange() turns the platform predicate off, as on Windows, and the signal fixture makes the exchange tools fail to start.
  • One case asserted the old window (override work that loses authority leaves the package moved away). It keeps that assertion for the two-move sequence and gains a counterpart for the exchange, where nothing moves.
  • The cross-device stage case now refuses every rename out of the stage, which is what a real cross-device stage does, so it also covers the fallback from an unavailable exchange.
  • The child fixture counts mkdtemp and writeFile as boundaries too, which adds boundaries to the two existing adoption sweeps without changing what they assert.

Review. The autoreview helper cannot run on this machine. Two fresh read-only agents reviewed the diff, the second after the fixes for the first. Resolved: an exchange that ends in an unknown state no longer reports a verified rollback or retires anything; ownership is checked again right before the exchange; the sweep asserts every boundary; the non-clean outcomes and pnpm have tests; the signal fixture restores execFile; the docs name the pnpm and Bun recovery target, the in-place retirement condition and the remaining rollback window. Not changed: a failed return of the candidate to its stage still fails the update (see User Impact).

Not proven.

  • The journaled npm path, linked roots, Windows and FreeBSD keep their window. None of them was changed.
  • An updater killed while the exchange tool is still running: the tool can finish the one system call afterwards, which leaves either valid state. Reasoned and documented, not tested. The fixture cuts before it starts the tool.
  • Whether signal compensation can start while an exchange tool is still running was not traced beyond the existing signal tests, which pass.
  • pnpm and Bun were exercised through the fixtures, not through a real global project, and not in the kill sweep.
  • No run on a native x86_64 host, on Bun as the running runtime, or on filesystems other than APFS and the Docker volume.
  • Only the in-place Docker cell was run. No published-driver cell covers pnpm or Bun.
  • The full affected set was not rerun after the merges of main, only the six focused files.
  • The full affected set was not rerun after the fixture commit below; only the tests it names were.

@clawsweeper

clawsweeper Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

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

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes scripts Repository scripts size: L labels Nov 17, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 17, 2026
@clawsweeper

clawsweeper Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR uses atomic directory exchange for supported unjournaled package updates while retaining the existing two-move fallback.

Example: An unjournaled update replaces OpenClaw 2026.11.3 with 2026.12.1 on Linux with system Perl.

  • Before: Killing the updater after the backup rename leaves the package path missing.
  • After: Atomic exchange leaves either the complete old package or the complete new package at that path.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation has useful production-path evidence and a focused design, but the broken restart fixture prevents a passing patch assessment.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An interrupted package update can leave openclaw unable to start because its installed package path is missing.
Reason: The maintainer-authored change addresses an evidenced failure using the existing exchange capability and explicitly preserves the separate journaled publication contract.

Merge readiness

⛔ Needs changes before merge - 1 item remains

This PR addresses a real updater crash window and merits keeping open, but its new module import breaks the existing restart regression fixture.

Priority: P2
Reviewed head: 37922d1585c5784dd527052c5bb1d0990d48015a

Before merge

  • [P2] Load the extracted publication owner in the restart fixture (P2) - The new import is absent from the explicit production-module list in scripts/tests/update-restart-swap-fixture.mjs. createDiskSwap therefore substitutes throwing stubs for canExchangeStagedPackageRoot and publishStagedPackageRoot, so its filesystem restart cases fail before exercising backup retention. The catch path then invokes another stub, masking the first exception as Unexpected package dependency: ../process/exec-result.js:hasCommandProcessCleanupError; this matches the exact-head checks-node-compact-small-2 annotations. Update the fixture to load the publication owner and its exchange dependency with the runtime capabilities they require, preserving the existing restart assertions.

Findings

  • [P2] [P2] Load the extracted publication owner in the restart fixture — src/infra/package-update-swap.ts:43-46

Tests

  • Missing end-to-end proof: Provide a latest-stable v2026.11.4 upgrade followed by the candidate's own unjournaled update, showing atomic publication and intact settings/data in redacted terminal output or logs.
Agent review details

How this fits together

The package swap owner receives a staged npm package or pnpm/Bun global project and publishes it, retaining the previous installation for verification, rollback, and cleanup.

flowchart TD
  A[Staged package or global project] --> B[Existing package swap owner]
  B --> C[Capture local overrides]
  C --> D[Atomic directory exchange]
  C --> E[Two move fallback]
  D --> F[Verify package and launchers]
  E --> F
  F --> G[Rollback or retire backup]
Loading

Technical review

Best possible solution:

Reuse the existing exchange primitive within the unjournaled swap owner and update the restart fixture to load its extracted publication owner.

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

Current-main source moves the installed package away before override capture and candidate publication, directly exposing the reported missing-path interval; the contributor also records red/green kill sweeps, but no target code was executed during this review.

Is this the best way to solve the issue?

The exchange preserves the existing post-publication package and backup names, allowing current rollback and retirement owners to remain authoritative; extracting the substantial publication boundary is justified, and retaining the documented fallback avoids blocking unsupported environments.

Full review comments:

  • [P2] [P2] Load the extracted publication owner in the restart fixture — src/infra/package-update-swap.ts:43-46
    The new import is absent from the explicit production-module list in scripts/tests/update-restart-swap-fixture.mjs. createDiskSwap therefore substitutes throwing stubs for canExchangeStagedPackageRoot and publishStagedPackageRoot, so its filesystem restart cases fail before exercising backup retention. The catch path then invokes another stub, masking the first exception as Unexpected package dependency: ../process/exec-result.js:hasCommandProcessCleanupError; this matches the exact-head checks-node-compact-small-2 annotations. Update the fixture to load the publication owner and its exchange dependency with the runtime capabilities they require, preserving the existing restart assertions.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • node scripts/run-vitest.mjs run test/scripts/update-restart-module-outcome.test.ts --maxWorkers=1
  • node scripts/run-vitest.mjs run src/infra/package-update-swap.test.ts src/infra/package-update-release-switch.process.test.ts --maxWorkers=1
  • node scripts/run-oxlint.mjs scripts/tests/update-restart-swap-fixture.mjs
  • git diff --check

What I checked:

Likely related people:

  • Jason (Json): Raw commit 51ceecd adds src/infra/path-exchange.ts:117 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 51ceecd7aeb9; files: src/infra/path-exchange.ts)
  • Peter Steinberger: Raw commit d1a69c0 adds src/infra/package-update-swap.ts:18 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d1a69c0b2095; files: src/infra/package-update-swap.ts)
  • Vincent Koc: Raw commit ca7ef93 adds src/infra/package-update-swap.ts:6 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: ca7ef93a9985; files: src/infra/package-update-swap.ts)

PR surface

Source +180, Tests +364, Docs +61, Other +8. Total +613 across 16 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 220 40 +180
Tests 10 405 41 +364
Docs 1 63 2 +61
Config 0 0 0 0
Generated 0 0 0 0
Other 1 8 0 +8
Total 16 696 83 +613

Preflight source

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This improves interruption safety for specific package-update layouts and has a focused, repairable test integration defect.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp 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 16, 2026, 9:41 PM ET / November 17, 2026, 02:41 UTC.

…xture

The fixture names each production module it runs and treats any other import
as an unexpected dependency, so the new publication module failed
test/scripts/update-restart-module-outcome.test.ts in CI. The fixture's context
reports a fixed platform, so it keeps the two moves and never makes a host
exchange call.
@fuller-stack-dev
fuller-stack-dev merged commit f52f728 into openclaw:main Nov 17, 2026
131 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

@fuller-stack-dev
fuller-stack-dev deleted the fix/update-plain-swap-atomic-publish branch November 17, 2026 03:39
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 17, 2026
…ed while replacing the package (openclaw#200366)

* fix(update): openclaw cannot start when a pnpm, Bun or unjournaled npm update is killed mid-swap

* test(update): load the swap publication module in the restart swap fixture

The fixture names each production module it runs and treats any other import
as an unexpected dependency, so the new publication module failed
test/scripts/update-restart-module-outcome.test.ts in CI. The fixture's context
reports a fixed platform, so it keeps the two moves and never makes a host
exchange call.
RomneyDa added a commit that referenced this pull request Nov 17, 2026
Backport #200366 and #200460 through the stable swap and publication owners.
Use an atomic exchange where supported, preserving journal recovery, native
project rollback, local overrides, and the existing two-move fallback.
Revalidate the current mutation owner before exchange and fallback effects.

Source commits: f52f728
and 413d9ee.

Co-authored-by: RomneyDa <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 19, 2026
…te is killed mid-conversion (#200273)

Adoption of a plain package directory renamed it into releases/ and then renamed a link onto the package path, so the path was missing between the two renames. It now prepares the link inside the release and exchanges the two paths in one atomic step (renameat2 RENAME_EXCHANGE on Linux, renamex_np RENAME_SWAP on macOS), through Node FFI, osascript or the system perl. Where no exchange is available the two renames still run, and the package-swap step says which method ran.

(cherry picked from commit 51ceecd)

Release dependency: supplies the path-exchange owner required by selected #200366/#200460. Companion fixes follow in this lane. Release adaptation: none.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit a24b6e0889ba715166e5f36d47835011932cb7a2)
RomneyDa added a commit that referenced this pull request Nov 19, 2026
…ed while replacing the package (#200366)

* fix(update): openclaw cannot start when a pnpm, Bun or unjournaled npm update is killed mid-swap

* test(update): load the swap publication module in the restart swap fixture

The fixture names each production module it runs and treats any other import
as an unexpected dependency, so the new publication module failed
test/scripts/update-restart-module-outcome.test.ts in CI. The fixture's context
reports a fixed platform, so it keeps the two moves and never makes a host
exchange call.

(cherry picked from commit f52f728)

Companion disposition: #200273 prerequisite included; #200460 extends journaled publication next. Release adaptation: none.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit e262d0822fe7c38d795a5e0491008a0070b5304e)
RomneyDa added a commit that referenced this pull request Nov 19, 2026
…e publishing the package (#200460)

* fix(update): keep openclaw runnable when an npm update is killed while publishing the package

* test(update): avoid a shadowed name in the surviving exchange tool test

* test(update): keep the displacement refusal and manifest-read tests on their paths

(cherry picked from commit 413d9ee)

Companion disposition: #200273 and #200366 prerequisites included; #200532 and #200550 recovery companions follow. Release adaptation: none.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 156510063401de1ab38e8def5d0acfe381ef813f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: L 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