How an update runs
How openclaw update switches channels, checks the new version, hands off the restart, and updates a Git checkout
Channel switching, update validation, the restart handoff, and the Git checkout flow. Part of the openclaw update reference.
What it does
Switching channels explicitly (--channel ...) also keeps the install method
aligned:
dev-> creates or reuses a git checkout (default~/openclaw, or$OPENCLAW_HOME/openclawwhenOPENCLAW_HOMEis set; override withOPENCLAW_GIT_DIR) and builds its first release. The checkout stays the source. The CLI runs the release link; the service starts through the release launcher.stable-> installs from npm usinglatest.extended-stable-> resolves the public npmextended-stableselector, verifies the exact selected package, and installs that exact version. It does not fall back to another selector and is rejected for Git checkouts.beta-> prefers npm dist-tagbeta, falling back tolatestwhen beta is missing or older than the current stable release.
Fresh clones are validated before publication. If the destination or staging
folder is replaced during validation, the update stops without changing the
replacement. Choose an empty OPENCLAW_GIT_DIR and retry.
Validation and activation
Git updates check exact candidates' Node requirements before runtime retention, snapshot staging, or candidate checkout. Incompatible development candidates are skipped so an older compatible commit can still be selected. Local rebases and reference build inputs can change the manifest; their resulting Node requirements are checked before installation and building.
Git --dry-run reports the selected target's Node requirement when its manifest
is available locally, or explains why compatibility could not be checked. It does
not fetch missing objects or predict the result of local rebases and build-tested
fallbacks. These checks require the installed updater to contain the fix; they do
not install or activate another Node runtime.
Readiness checks share an overall deadline across native service inspection, listener checks, authenticated RPC, and HTTP readiness. A network probe's per-request limit does not shorten native inspection. Slow inspection still consumes the shared deadline, so it cannot extend the update's overall budget. These checks belong to the installed updater; a candidate cannot change an older updater's already-running readiness wait.
On Windows, Doctor restoration uses the same cold-start readiness allowance as Gateway start and restart, including when Doctor runs as part of update repair.
Before replacing the same installation, the updater observes the incumbent Gateway once. Failed readiness produces a warning and prevents automatic rollback from restarting it; the updater does not wait for the incumbent to recover before replacing it. The replacement still receives the full startup and readiness verification. Certifying a service rooted in a different installation, or verifying a restored service after restart, still waits within the existing readiness budget.
On Windows, candidate commands verify their recorded handoff lease and their own
PID/start identity even when the launcher process tree changes. A different
immediate parent no longer causes a valid candidate to fail with Candidate executor binding does not match its parent. The update owner must remain live,
and changed or revoked leases still refuse mutation. This check runs in the
candidate, so it also accepts valid handoffs from older installed updaters.
If a service refresh refuses before writing its definition, the candidate keeps the original refusal in its output. The updater can then revalidate and restart the preserved service definition. Actual loss of native service authority still leaves recovery pending until ownership and restoration can be verified.
On Linux, service refresh repairs group/other-writable unit files and legacy backups created by older installers, provided they are regular files owned by the service account in safe directories. It backs up the prior definition and regenerates the unit and backup with owner-only permissions. Unsafe directories, foreign ownership, symlinks, and protected mounts still refuse replacement. This repair runs in the candidate installer, including when an older installed updater invokes it.
Load slows updates rather than establishing failure: startup inspections and recovery backlogs keep acceptance pending within the installation owner's bounded readiness budget. The managed-release controller waits for the marker agent's admission and a responsive Gateway, and retries timed-out marker dispatch with its original idempotency key only after proving the selected process is healthy. The restored predecessor uses the same acceptance rules. Wrong identity, physical corruption, a wrong marker reply, or exhaustion of the readiness budget still requires failure recovery.
Channel probe failures, stopped channels, and health collection timeouts are
warnings during post-update verification.
The Gateway must still answer, report the expected version and build, pass HTTP
readiness, and pass the normal health checks. A channel fault that also
makes HTTP readiness fail still fails verification. Timeout warnings remain in the update report even
if a later probe completes; run openclaw health to check the affected channels.
The seven-second collection budget is unchanged. Updated Gateways also avoid
reporting collection timeouts as negative probes to older updaters, although those
updaters cannot add the new warning to their update reports.
If the resolved registry package version equals the installed version without changing the selected channel or installation method, or the Git release is already current and its runtime passes artifact verification, plugin convergence still runs; if plugins and runtime artifacts remain unchanged, the run finishes skipped with reason already-current. Git currentness checks compare the selected source with the running release, not just the checkout's HEAD.
Runtime maintenance can therefore succeed without changing the Git revision.
A same-version explicit --channel or installation-method change finishes successfully.
Changed plugins restart a running managed Gateway unless --no-restart is set; retained exact pins produce the same advisories as a core update without requiring a restart. Plugin record rewrites that change only resolution, installation, or capability acceptance timestamps are not plugin changes: they do not reload plugins or restart the Gateway.
If a Git runtime has missing or unverified artifacts, matching source alone does not make it current.
Verification checks the build commit, both build stamps, runtime entry, Control UI assets, version, and build identity.
OpenClaw builds and validates a separate release without replacing the checkout's runtime.
The running Gateway keeps its release. The next start uses the release selected by the launcher.
With --no-restart, the new release stays pending until the next service start.
The update does not rewrite a managed service that still starts the checkout's
dist/index.js or openclaw.mjs. It leaves a forwarding marker in the checkout
(.git/openclaw-launcher, or .openclaw-launcher in a linked worktree), so that
entry starts the release launcher. openclaw gateway status, openclaw doctor --fix
and openclaw update repair treat that service as this installation's, serving the
release the launcher selects, and leave its definition unchanged.
A package install's managed service that still starts the old package is staged
onto the release launcher without starting or restarting the Gateway. Linux reloads
systemd's unit metadata without restarting the unit; macOS reloads the staged plist
on the next OpenClaw restart or login; Windows runs the updated task script on its
next start. If staging fails, update history records the service-definition refresh
as owed.
Stopping another Gateway that shares this installation protects its running
code; it does not migrate that Gateway's separate state. If its older state
requires migration, run the updated CLI's doctor --fix under that service's own
account, profile, and environment before resuming it. Doctor may restore the
service itself, so inspect its status before starting it again through its
service manager.
Source commands launched with pnpm openclaw also refuse an automatic rebuild
while that installation's Gateway is running. Use the installed openclaw update
or node openclaw.mjs update from the checkout to reach the updater's managed
handoff without the source wrapper rebuilding first. Manual pnpm build remains
an operator action: stop the Gateway before rebuilding its installation.
This decision runs in the installed updater. An older updater that returns
already-current with runtime-verification-failed cannot obtain the fix from a
candidate it never builds. Stop the Gateway through its actual service manager,
rebuild the checkout, and start the Gateway through that manager before retrying.
Do not rebuild its installation while the old Gateway is still serving.
Linux updates also refresh outdated OpenClaw-managed systemd policy when the core
is already current or --no-restart is set. This policy-only refresh confirms
daemon-reload without stopping the Gateway and preserves operator drop-ins.
Native-definition reconciliation on launchd, Scheduled Tasks, and systemd keeps
custom policy values with an advisory while refreshing recognized old defaults.
For example, TimeoutStartSec=45 stays unchanged while the old installer value
TimeoutStopSec=30 becomes 330. Existing identity and command checks still apply.
Maintenance stops also read the resident Gateway's recorded shutdown budget.
If rollback finds the service already stopped, the Gateway cannot be reached,
and its local port is free, it proceeds directly through the guarded native stop
to restoration instead of waiting for the drain deadline. Running Gateways and
unverified service or port states keep the normal drain checks.
Published 2026.9.5 residents keep their startup budget even after daemon-reload;
their first stop therefore uses the short/unknown-budget path. The Gateway's
lifecycle owner fences admission and reports drain progress until idle or the
existing update step deadline (30 minutes by default, 45 for automatic updates).
At that deadline, remaining turns can be interrupted with a warning in update
history; reported write custody refuses the stop and names its owner phase.
Residents without the optional writeCustody observation cannot distinguish
backup or migration custody from ordinary root/cron work. At the deadline, they
stop with a warning naming those counts; missing custody information never blocks
the update. The next Gateway starts with the refreshed service policy. An operator drop-in
that still shortens the native timeout is preserved and reported.
An already replaced Gateway that rejects connections because its runtime files are unavailable is stopped through its service owner with a warning instead of waiting for an RPC it cannot serve. For the older error emitted by published June Gateways, this also requires a live legacy lock and local listener matching the owned service PID. Listener ownership, the lock, and native service identity are rechecked before stopping. Missing listener attribution or an unrelated connection error keeps the normal drain path.
Two layouts run the Gateway as the direct child of a launcher that is the
service's main process: a release install, whose service runs
~/.openclaw/git-install/openclaw-launcher.mjs, and a service whose Node fails
the Gateway's runtime check, which OpenClaw reruns under a compatible Node it
finds, such as its private runtime in ~/.openclaw/tools/cli-node. Maintenance
drain, which Doctor and openclaw update repair also use, accepts the child as
the service's Gateway only when every listener on the Gateway port is that
process and its parent is the service's main process. When no listener names
its process, for example on a Linux host without lsof or ss or when ss
cannot see the owner, the drain instead requires the kernel parent of the
process the Gateway reports to be the service's main process. Stopping the
service stops both.
With --no-restart, the package is replaced under a running Gateway, and that
Gateway restarts itself when its installation check sees the new files. On a
Linux systemd service the restart can land while a maintenance stop, such as
update Doctor's, is draining and stopping the Gateway. The stop then finds a
different process than the one it inspected. If the latest shutdown the Gateway
recorded belongs to the inspected process and names the replaced installation,
the stop inspects the service once more, rechecks its ownership and definition,
records a warning in update history, and drains and stops the restarted process.
The update continues. A process change without that record is still refused with
Gateway process changed during maintenance drain, and so is a second change.
A stop that inspects the service during systemd's restart delay (RestartSec=5
in the managed unit), while neither process is running, is also still refused. Its
service ownership check then reports the service as unavailable.
This handling is part of the new version's maintenance stop, which the installed updater runs from the replaced package. It applies to the first update to a release that contains it, provided the running Gateway records its installation-replacement restart.
Maintenance drain uses the service's local credentials, including an existing
paired operator identity when no shared token or password is configured. It does
not create an identity or request new pairing. Older installed updaters that omit
this identity can report device identity required and wait until their existing
drain deadline before stopping with a warning. A newer candidate cannot change
that already-running updater; subsequent updates use the corrected local control
client after installation.
Explicit package artifacts, such as tarball paths and URLs, compare known build IDs before a same-version no-op. Matching known identity leaves the package unchanged; different or missing identity continues through normal update validation and installation because a matching version alone does not establish artifact equality. Registry requests retain their version-based same-version no-op. Installation-method switches and fresh-profile initialization still retain and validate the new version even when its build identity matches.
Updates continue with recorded warnings when disposable validation-copy cleanup,
retired derived-cache cleanup, or Git upstream tracking setup fails. Resolve the
reported cause, then run the warning's exact cleanup command or
openclaw doctor --fix. Invalid ownership, unsafe state migrations, and a Gateway
that cannot boot or pass readiness still block completion. See
Status and history to inspect recorded warnings.
Linux service checks treat an implicit systemd unit name and its explicit
installed name as the same selection, including names with or without the
.service suffix. The updater still rechecks service ownership before stopping
the Gateway.
Linux user-service stops use the same sequence during updates and standalone
openclaw gateway stop: inspect the manager route, check current custody, then
stop the selected unit. Manager inspection has its own 60-second allowance and
retries one transient timeout with a recorded warning. A second timeout names
the stalled check and leaves the original Gateway running; ownership refusals
are never retried. The installed updater owns this sequence, so a candidate
cannot change an older updater's stop behavior during its first update.
During finalization, an explicit update timeout includes Doctor preparation, maintenance admission, and the fresh Doctor process. Nested service inspection and stop attempts receive only the remaining allowance. An expired allowance prevents new effects; an already admitted stop still settles and retains the existing restoration path. This requires the running updater to contain the fix; a new candidate cannot change an older updater’s parent deadline.
Unavailable service inspection produces a recorded managed-service warning,
including the manual restart action. A stale, uninspectable service record cannot
select the update's package root, Node executable, or state directory. Staging,
validation, installation, and Doctor finalization continue in the invoking
installation. Doctor leaves unverified service records unchanged and reports an
advisory; state coordinators and database leases still protect active writers.
For recovery of a managed service using a separate, unchanged installation, OpenClaw rechecks its service definition, runtime pin, package directory and version, launchers, Node executable, build identity, and schema support. It does not fingerprint that installation's entire package tree; edits elsewhere in that tree during an update are best effort. Keep tools that modify either installation stopped until the update finishes.
The baseline fingerprint of a package retained for rollback is best effort. If its bounded scan times out
or reaches its byte or entry limit, the update records a warning and continues
with the retained package directory.
Rollback then verifies the restored directory identity, package version, and
affected launchers, and records that full fingerprint verification was unavailable.
A scan budget alone does not fail the update or rollback; unavailable or changed
directory identity, invalid package metadata, and affected-launcher failures still
refuse restoration. Once a complete baseline
fingerprint is available, recovery checks must match it. These checks use the
caller's per-step allowance without a separate thirty-second scan cap.
If a retained or restored package changes, the failure names the exact package
path to inspect before retrying recovery. Sibling .openclaw.update-stage-*
directories are outside that package fingerprint; do not remove stages that
another updater may still be using.
Launcher backups verify the saved file bytes or symlink target. Recreating an equivalent npm or Homebrew launcher does not invalidate recovery because its inode, timestamps, or ownership metadata changed. A changed symlink target still refuses the swap and names both targets; filesystem mutation ownership checks remain in effect. This fix belongs to the installed updater, so a candidate cannot change an older updater's launcher checks during that first update.
On POSIX npm installations, publication admission checks the existing package
directory or source-link entry and standard launchers before staging. The source
link check does not require ownership of the external checkout. Additional launcher destinations
are checked against the staged candidate before validation; unrelated prefix files
are left alone. An ownership
refusal names the object path, its owner UID, and the expected UID. Writable
prefix parents such as bin and lib/node_modules may belong to another UID;
their directory identities still must remain unchanged during publication and
recovery. Published objects and private recovery artifacts retain their ownership
checks. This admission behavior belongs to the installed updater, so it cannot
repair the checks in an already-running older updater.
Journal-owned publication and rollback also compare launcher bytes or link targets, without requiring uid/gid metadata that a non-root updater cannot restore. They still require the recorded launcher identity before replacing it. New symlinks preserve the existing launcher's ownership when possible; otherwise they use the updater's effective user and group instead of inheriting an unusable bin-directory group. An ownership fallback produces a warning.
Package publication verifies the candidate before activation and the installed package after publication. Launcher publication checks package identities without repeatedly hashing both generations. Retirement verifies the live package before deleting obsolete backups; rollback still hashes a backup before restoring it and verifies the restored bytes. These improvements belong to the installed updater and do not change an older updater already running.
Retaining the updater's runtime skips package recovery anchors, control journals, and settled evidence beside installed packages. Even hard-linking unchanged recovery files would change their metadata and could invalidate an older sealed helper's fingerprint. Explicit runtime links into those recovery artifacts are rejected; the evidence remains untouched for its recovery owner.
Unchanged retained runtime files use hard links when the filesystem supports them. The same-inode path does not rehash content. If linking changes file identity, retention verifies size, mode, and a stable content hash against the inventory, accepting equivalent filesystem copy-up. A failed check makes the whole retained runtime unusable: the updater logs a warning naming the file and check, leaves the tree unbound, and continues. Package rollback keeps its separate verified backup; the warning makes clear that no verified retained rollback runtime is available. Files requiring plugin-safety checks or relocation use verified copies.
Candidate verification uses the same best-effort contract when its scan reaches the resource limits: activation and publication continue with directory identity, package version, and launcher verification, recording that full package contents are unverified. The reader allows 500,000 entries / 8 GiB; the shared deadline still bounds scan time. When a scan completes, its fingerprint must still match.
When full verification is available, these checks walk every entry to verify identity, metadata, directory listings, links, and a final metadata sweep. A file's content digest from the earlier baseline or staged-package scan is reused only when its complete metadata, including inode, link count, size, modification time, and change time, is unchanged and its change time predates that earlier read by at least five seconds. Files that were too recent during preparation become eligible after a later successful verification observes them settled; subsequent publication checks reuse that observation while still comparing against the original package fingerprint. Recovery helpers and later commands re-read file contents. Like the metadata sweep, these checks observe the package rather than lock it: writes through an already-modified shared memory mapping may not update file times. Keep other package managers and tools that modify the installation stopped during an update.
Future installed updaters hash package files in short-lived worker threads with synchronous reads, at most four files at a time. The sealed recovery helper uses the same path; if worker threads are unavailable, hashing runs in-process. A file whose digest is reused under the rule above is not re-read; every other file is read afresh in the workers. The asynchronous directory walk, serial final metadata recheck, and deadlines are unchanged. Older installed updaters keep their own scanning behavior.
The published 2026.9.7 and 2026.9.8 updaters still use their own 50,000-entry /
1 GiB caps for candidates; the candidate cannot change that installed driver.
For a supervisor version of 2026.9.8 or earlier, including prereleases, candidate
admission refuses a tree with more than 50,000 entries and directs you to run
npm i -g openclaw@latest manually (preserving the requested version or tag when
specified). This counts
the package root and every entry, including hidden lockfiles, without following
symlinks. Newer supervisors do not receive this size refusal.
An older installed updater that stops with Package rollback verification entry limit exceeded or Package rollback verification byte limit exceeded likewise
needs the installation's manual package update method,
with a verified backup and the managed Gateway stopped during replacement.
Interrupting a fresh local update before activation records a failed,
interrupted history entry while its installation owner is still held.
A pre-activation interruption is not a successful update or a verified rollback.
Unresolved effects remain visible in the update report. Unsupported pending
checkpoint records block further mutable update work and remain unchanged.
During activation or verification, SIGINT, SIGTERM, and SIGHUP stop forward work
and retain the updater until its existing recovery owner has attempted to restore
the Gateway and write the failure report. Recovery uses the update's existing
budget and package/state safety checks. The report names the interrupted phase
and signal; use openclaw update status and, if recovery remains pending,
openclaw update repair. This requires the fix in the installed updater; a new
candidate cannot change an older driver's signal handling. SIGKILL cannot run
this cleanup and still requires explicit recovery.
After the target Doctor migrates shared state, the installed target runtime owns database validation, service finalization, and update-history writes, including rollback outcomes. The parent updater retains its live installation and requester checks without reopening migrated state through its older schema. A successful migration proceeds to finalization; it still prohibits code-only rollback.
For versions that support checks before installation, the old Gateway keeps serving through staging and
validating. During validating, the updater runs the new version's recovery
worker once (update-migrated-finalize --check, recorded as candidate-recovery).
This loads the new version's complete recovery code and reports the database
schema versions and update contract it supports, without reading or copying
state. A candidate whose recovery code cannot load, or that does not report its
database versions, is refused with runtime-verification-failed before anything
changes. Candidates without this worker finish through the installed updater's
existing path and record a candidate-runtime-unavailable advisory.
The updater does not copy state, run Doctor, or start a test Gateway before
activation. Doctor, configuration validation, plugin loading, and Gateway startup
run once, on real state, after activation. Before activation the updater captures
a database baseline of every SQLite schema it may migrate. If activation Doctor or
the restarted Gateway fails, the updater restores the previous release and that
baseline. With --no-restart, the updater starts the activated release once on a
private loopback port (activated-gateway-startup) with channels, providers, cron,
and other side services disabled, and rolls back when it does not become ready.
It skips this boot when another Gateway still owns the state, for remote-only
profiles, and for TLS Gateways; the result records why.
Before staging changes anything, snapshot-space-preflight measures the known
SQLite families and refuses only when the activation database backup or rollback
cannot fit. When recovery copies from earlier updates could free that space, the
cleanup offer described below applies.
Private rehearsal by older installed updaters
Installed updaters released before this change rehearse the candidate on private
copies of state while the old Gateway serves. They run the new version's health
checks (doctor --lint --json --severity-min error), config validation,
read-only plugin resolution, and a repair Doctor, then boot a test Gateway in an
isolated temporary state directory. The new version keeps the candidate-side
support those updaters call: its state-copy worker, rehearsal-aware Doctor, and
--update-canary startup progress. The rest of this subsection describes that
rehearsal. "The updater" means the older installed updater running it.
The copied database registry points to the copied agent databases. Installed
plugin payloads and their dependencies are also copied, including plugins
discovered in the global extensions directory without install records or
explicit load paths. The copied install records point to those copies, and their
OpenClaw host links target the staged installation. Literal imports, require()
calls, and literal dynamic imports to shared source modules include those modules
and their package metadata in the private copy. Unrelated repository files remain
outside the snapshot.
Plugin snapshots verify inventoried bytes with SHA-256. Native companion captures may add or remove hard links while the old Gateway serves; link-only metadata changes do not invalidate unchanged files on Windows or POSIX, including Android/Termux when libuv derives birthtime from ctime without statx. Content, file identity, type, permissions, ownership, size, and modification-time changes still refuse the snapshot.
This check belongs to the installed updater. An older updater that reports
Plugin entry changed after snapshot inventory during native capture cannot
obtain this repair from the candidate it is already validating. Use the
installation's manual update method, with a
verified backup and the managed Gateway stopped during package replacement.
Before each candidate check starts, the updater names the check and command.
These progress messages go to stderr with --json, leaving stdout for the JSON
result. The installed updater owns these announcements, so an older updater gains
them on its next update after installing this version.
Plugin dependency inventory skips incidental Git runtime transaction directories
left by older in-place updaters, named <destination>.openclaw-update-.tmp. Their candidate and rollback
contents stay untouched; explicitly referenced dependencies still undergo normal
validation. Other temporary directories remain plugin inputs. This prevents an
abandoned transaction's relocated links from blocking an unrelated update.
This inventory runs in the installed updater. An older updater that fails with
Cannot privately copy plugin dependency inside one of these transaction
directories needs the installation's manual update method
before it can use the fix. Preserve transaction contents until any active update
or rollback has been reconciled.
When a published updater omitted shared modules from an external plugin copy, the new version’s Doctor can complete the private copy before loading plugin repair hooks. Recovery requires the original path retained by that updater and matching source/manifest bytes; it never replaces existing private files or changes the serving plugin. Complete snapshots do not require the original source to remain available. Some older managed-state or cross-volume projections do not retain a recoverable original path, which Doctor reports in the update diagnostics.
Path aliases that resolve to a running package's bundled plugin use the staged bundled plugin with the same ID when available, preserving bundled trust. External path installs keep their existing classification. The live plugin files and host links stay unchanged. Channels, cron, automatic updates, and other side services are suppressed in this canary. The copied databases undergo the same schema checks and migrations without reviving the removed Tasks registry. The canary also defers session catalog hydration, subagent and worker recovery, and startup maintenance until activation, recording a warning. Required configuration, database ownership, schema, and migration checks still run before readiness; plugin runtime loading remains part of validation. The serving Gateway prepares its session catalogs and maintenance normally after activation.
Before copying state, the updater admits its existing-schema progress writer and retains that connection through validation. Progress writes therefore keep the shared database's WAL files available while SQLite takes a consistent snapshot. The connection reuses its admitted schema facts while each write still checks current authority, source identity, and schema changes. This prevents progress recording itself from interrupting the copy; integrity and replacement checks remain enabled. The installed updater must contain this fix. A new candidate cannot change an older driver's initial snapshot behavior.
An initial progress receipt refusal stops validation before state copying or child startup. If saving a completed check fails, the updater preserves the reporting error; that check keeps its successful result and is not reported again. The updater still settles owned child processes and temporary-copy cleanup. Progress errors while a stage is active retain that stage's existing failure and cleanup handling.
After the canary passes, the updater records temporary-copy cleanup and previous-Gateway
readiness verification as active steps. openclaw update status, including --json,
shows the recorded operation, wait reason, start time, and budget. Readiness observations
refresh at most every 30 seconds within each check stage. Verification checks the managed
service, listener identity, installed version/build, health RPC, and HTTP readiness.
Older updaters allow ten times the canary startup duration, with a five-minute minimum
and one-hour ceiling. Current updaters allow five minutes (90 minutes on Windows);
an explicit --timeout takes precedence.
Expiry records a warning and continues with previous-Gateway readiness unverified;
automatic rollback cannot restart an unverified previous Gateway. Run
openclaw gateway status --deep --require-rpc to inspect it.
Each disposable-copy cleanup has a five-minute allowance. If removal takes longer,
the update records a warning and continues; removal may still finish in the background.
The warning names the temporary path and explains cleanup after the updater exits.
These progress improvements require the repaired updater on the next update hop.
An already-running 2026.9.5 updater retains its original silent verification window;
independent openclaw gateway status --deep --require-rpc and /readyz checks can show
whether the old Gateway is still serving, but do not establish the updater's wait reason.
The update result, openclaw update output, and the run history record timed steps
for the private state copy (candidate-state-snapshot), the rehearsal Doctor
(candidate-doctor), the test Gateway startup (candidate-gateway-startup), and
temporary-copy removal (candidate-state-cleanup), including Git updates. Activation
also records post-stop-checks (the schema, artifact, and configuration checks after the
Gateway stops). Each Doctor the updater launches adds one
Doctor sections: … diagnostic with its database preflight, configuration, and
contribution times, plus the slowest contributions. Run history keeps these rows when
older diagnostics are trimmed. The updater that is already installed records these
steps, so they first appear on the update after the one that installs this version.
The report also preserves updater-runtime-retention, which measures retaining
the running updater's package, built runtime, and dependency tree before mutation.
This is separate from the private-state snapshot and can run while the previous
Gateway is still serving. Native service work records managed-service-executor-check
separately from the successful managed-service-install or managed-service-restart
child. update-driver-handoff measures the interval from the previous driver's last
completed receipt until the fresh driver resumes finalization. The handoff timer
can appear on the installing update; retention and service timers require the
updater executing those operations to include this instrumentation.
Update build and validation processes resolve source-linked plugin SDKs from the staged installation root, even when the serving source launcher passed its own checkout root. This keeps staged assets and validation independent of the old checkout.
Doctor warnings do not block update checks or readiness after plugin updates.
The updater retains them in the run report shown by openclaw update status,
including when an intentional open channel policy requires no configuration change.
Required config, state-safety, and readiness failures still refuse the update.
After the package is installed, a failed post-plugin Doctor process is a recorded
warning when it has no explicit writer or migration refusal. The updater still
validates the final config and readiness, then starts the Gateway. A child whose
termination cannot be confirmed remains blocking because it may still write state.
A plugin convergence failure, or an updater failure around a started Doctor, can
instead be recorded as an owed step, under the conditions listed
there.
Offline Doctor cron inspection reuses its admitted maintenance reader after the
backup boundary instead of creating another disposable SQLite snapshot. If optional
memory dreaming cron ownership inspection is unavailable, Doctor retains existing
rows and the pending plugin repair, records a warning, and continues core recovery.
Run openclaw doctor --fix to retry that inspection. Cron rewrite and required
state migration failures retain their existing safety checks.
Doctor's disposable database migration and repair connections use a 64 MiB SQLite page-cache allowance to reduce repeated reads while rebuilding large stores. The allowance ends when each connection closes; serving connections keep their existing cache policy. Transcript conversion also reuses parsed JSON while preparing navigation metadata, preserving the original transcript bytes. These candidate-side improvements apply when an older updater invokes the new Doctor; they do not change that updater's deadlines, integrity checks, or rollback rules.
In the private migration rehearsal, Doctor lint defers optional core inspections
until after activation. This includes per-agent model and tool-schema diagnostics;
lint does not prepare their runtime metadata when those checks are deferred.
Each omitted inspection records a warning with its check ID and a command to run
after the update. Required migration, configuration, plugin, and Gateway readiness
checks still run. Standalone Doctor lint and explicitly selected --only checks
keep their normal scope. The candidate recognizes the private-copy markers already
set by the published 2026.9.4 updater, so this reduces work on that first hop too.
When the updater is 2026.10.1 or later, each check has its own time budget, so
the candidate measures its optional-inspection window from that check's start; a
slow state snapshot or repair Doctor does not cause lint to defer inspections.
With older updaters, the window still starts when validation begins.
The rehearsal repair Doctor also defers pure advisory inspections, including security, provider catalog, and runtime tool-schema diagnostics, and records their IDs in its output without consuming repair-warning slots. Contributions that also perform repairs stay in the rehearsal, including auth profiles, plugin health repairs, skills, memory recall, and session transcripts. The live post-swap Doctor and final readiness checks keep their existing scope. This saving applies to published 2026.9.3–2026.9.6 updaters that supply the private-copy markers; older drivers keep their existing behavior.
These checks do not run an agent turn or require a usable model-auth route. OAuth-only installations and installations without provider credentials can update. Auth diagnostics are advisory; optional inference repair runs through triage only after a failed update has settled. It uses the normal runtime credential resolver, including shared profiles and OAuth refresh.
The new version answers the updater's native service capability check before loading configuration or initializing debug capture. Checking capability does not open or migrate shared state, so the old Gateway can keep serving while its database schema is older than the new version's. The installed updater runs first; this repair takes effect when the version it checks contains the fix.
The invoking updater supplies the capability check's per-step time budget. The check does not impose a separate startup deadline.
Snapshot preparation budgets time for the SQLite database and journal bytes, including copying and verification passes, with a five-minute startup floor. It uses the larger of that allowance and the configured per-step timeout. The deadline extends while private files continue changing. A stalled snapshot reports its size and applied budget. Snapshot time does not consume the separate runtime validation budget. Each validation process receives a fresh allowance that scales with measured database and plugin bytes. An explicit per-step timeout replaces that derived allowance. While retaining its own runtime, the updater reports completed file operations directly instead of repeatedly scanning the growing copy. If those operations stop completing, isolated filesystem checks still track a slow individual copy. This improvement applies when the installed updater contains the fix. Automatic and chat updates leave that runtime allowance derived from state. Their request and recovery watchdogs do not become update validation deadlines. Startup and readiness responses share their own allowance, including reading the response body. Completed candidate CLI and Gateway startup milestones from a fixed set of startup events renew that allowance once each; passing the original deadline records a warning while startup keeps progressing. Unknown names are ignored and logged at debug level. Check responses do not renew the allowance. The total readiness wait cannot exceed four times its initial allowance, even while milestones advance. Reaching that ceiling refuses the candidate and records the elapsed time and milestones reached, leaving the previous Gateway untouched. A candidate that exits or stops advancing fails validation with its last startup evidence. Unreachable checks without startup evidence and configured proxy failures remain warnings. This progress-aware wait belongs to the installed updater. The published 2026.9.4 updater retains its fixed five-minute cap when checking a newer candidate.
During a copied update rehearsal, candidate Doctor publishes its lint report before disposing plugin inspections. Its private state stays owned until disposal finishes or the owned inspector process tree is confirmed stopped. The disposal allowance follows measured check time and the remaining published-driver window; an overrun records a warning with its duration. This also lets the 2026.9.4 driver, which requires a zero process exit, finish when only disposal is slow. Supervisor-initiated disposal termination preserves completed checks on Windows as well as macOS and Linux. Caller cancellation and independent failed exits remain failures.
When a candidate Doctor completes its checks but its process or output pipes
remain open past the allowance, the updater records an exit-phase warning and
continues with the completed result. Lint completion requires that child's
complete JSON report; a preceding repair's Doctor complete. line cannot prove
lint success. Error findings still refuse validation. A child without a completion
result reports candidate-checks-timeout, the check phase, and elapsed time.
These deadlines belong to the invoking updater. The published 2026.9.3 and 2026.9.4 updaters
cap their complete rehearsal at five minutes, including the snapshot, and their
later schema inspection at thirty seconds, even with --timeout 900. Installing
a newer candidate cannot enlarge those parent-process deadlines on that first
update. Subsequent updates use the newer updater's allowances described above.
Hosts whose checks cannot finish within the 2026.9.4 rehearsal's five-minute window
still need the manual upgrade recovery path.
Before copying, the updater measures the shared and agent SQLite database families and the installed plugin payloads and dependency trees that the update checks need. Admission includes space for temporary copies and the new version’s Doctor backup. Active plugin payloads remain in the snapshot so configuration and startup validation can load them; unreferenced plugin generations are not copied.
The updater selects the first usable destination with enough measured free space:
- An explicit
TMPDIR, when set. - A private directory under
<state-dir>.update-captures/, beside the selected state directory on its filesystem. - The system temporary directory.
The update report records the measured SQLite and plugin sizes, the total
required space, the checked destinations and their available space, and the
selected location and reason. If none fits, snapshot preparation refuses before
copying with snapshot-capacity-insufficient and explains how to free space or
set TMPDIR.
When space is short and update cleanup
already counts some recovery copies from earlier updates as retirable, an
interactive openclaw update lists them with their sizes and asks whether to
remove them permanently, defaulting to no. On yes, the running Gateway, or the
updater itself when no Gateway runs, retires them and the update checks space
again before it changes anything. --yes, --json, updates without a terminal,
and Control UI updates never remove them; their refusal names the reclaimable
size and the next step instead. Git updates make this offer before they start;
their later pre-staging check still decides whether to refuse.
A path that cannot be allocated is recorded and skipped; if all
fitting paths are unusable, snapshot-location-unavailable names their path or
permission errors. Capacity checks do not reserve space against concurrent writes.
The copy worker uses the inventoried plugin plan. If an install record, plugin
owner, or database registration changes before its copy, preparation refuses
that unmeasured state so the next update can inventory it again.
These copies remain disposable validation state; rollback does not restore them.
If even the initial SQLite inspection copy cannot fit, the refusal reports that
required lower bound and marks plugin size as not yet inspected.
Snapshot placement belongs to the updater already running. The published 2026.9.3 and 2026.9.4 updaters prepare their snapshot before the new version’s code runs, so updating to this fix cannot change that first hop. If their system temporary filesystem is too small, select another filesystem with sufficient space:
TMPDIR=/var/tmp openclaw update --yesSubsequent updates use the new updater's measured destination selection.
Snapshot creation checks the source and the final transformed output for full SQLite integrity and foreign-key consistency. It validates the transformed output once, in private publication staging, and verifies its exact bytes before making the snapshot available. The same checks cover recovery backups. This avoids a duplicate full-database scan without changing the backup or rollback contract. The published 2026.9.7 updater selects its own snapshot worker, so its initial snapshot does not benefit from this change on the first upgrade. Updaters that select the staged candidate's worker can use the candidate's snapshot implementation.
Live snapshots use SQLite read transactions and private backups while writers continue. Artifact-preserving planning and Doctor checks retain byte-neutral copies that leave source SHM unchanged. WAL copies capture a bounded prefix within one verified WAL generation, so appended commits do not require a quiet database. When a live writer checkpoints during every copy attempt, the WAL family takes one read transaction instead of refusing: that writer keeps the WAL index current, so SQLite may update reader slots but not the commit header that update captures compare. Families without a live index never churn and stay byte-neutral. Incomplete WAL families and crash journals are recovered privately without creating missing source sidecars. Inspection budgets include database and journal sizes, cold startup, and repeated IO passes for every discovered store. Metadata checks remain cancellable. Copy progress renews the watchdog, and larger caller allowances are preserved. Workers stop before their private staging is removed; cleanup failures preserve the original error. If compatibility cannot be verified, rollback is refused. Inspection failures report the database or known scope, inspection phase, elapsed time, and the next action. Check access to the named path, concurrent writers, and storage performance before retrying. Older candidate workers that cannot report their current database identify the known scope instead.
Inspection before staging
If the initial config inspection encounters SQLite lock contention or a changing snapshot source, the updater repeats that read once. A successful read records a warning and lets target selection continue. Corruption and other inspection errors remain failures. A pre-staging failure retains its original diagnostic and next action in update history once fresh database admission succeeds; unresolved recovery ownership still prevents terminal publication.
This inspection behavior belongs to the invoking updater. A published 2026.9.4
updater can still fail before staging the candidate. In that case, use the
installation's manual update method, then run
openclaw update repair from the updated installation.
Before stopping the previous Gateway, the updater waits for affirmative readiness. Its observation window is five minutes (90 minutes on Windows), or the explicit per-step timeout. A transient readiness miss does not discard the previous generation's rollback eligibility. Native service and Gateway boot identities must still match through the final observation.
An older updater's test Gateway binds a free loopback port and must report /startupz as started,
then /readyz as ready within the runtime validation allowance. Plugin-resolution
errors attributed to a named plugin are recorded without rejecting the update.
An invalid plugin inventory, an unattributed registry error, or failure to meet
the required core startup or readiness checks still fails validation. Failure
records the phase, elapsed time, and bounded diagnostics. The updater attempts
process-tree termination and temporary-state cleanup. If bounded teardown does
not confirm both termination-request completion and child closure, it records a
maintenance warning separately from the validation result. Readiness, child
closure, and temporary-copy cleanup do not prove that every descendant stopped.
Temporary-copy cleanup remains best effort. This reporting belongs to the invoking
updater; the new version cannot change an older updater's teardown behavior.
The startup check proves the new version’s core startup on copied state; live channel and provider
behavior are checked after activation.
Targets that predate migration continuation record runtime validation as
unavailable and use the current updater's existing finalization path. A present
continuation entry with an invalid schema contract still refuses activation.
The database-schema preflight still refuses incompatible downgrades. These older
targets do not support automatic schema-neutral rollback; see
Downgrade finalization.
Blocking validation failures discard the staged update without stopping the serving Gateway. The updater does not run inference or repair the disposable validation copy. After a failed update has settled and released its ownership, eligible failures can enter post-failure triage. Triage preserves the original failed outcome; a repaired installation does not turn that update into success. See Unattended repair.
Published 2026.9.4 updaters can still request an inference-repair worker from the candidate. The candidate preserves that wire protocol and returns repair unavailable without loading inference or changing operator state. The installed updater still owns that first hop and its failure reporting.
For mutable package updates, activating stops the managed service. Its offline
work includes package replacement, required doctor --fix migrations, and state
compatibility inspection, followed by service start
in restarting. Update verification does not use model inference. In verifying,
the updater checks that the managed service is running and owns its port, requires
successful health checks and a Gateway hello handshake matching the
expected version and Git build identity, and verifies HTTP liveness and core readiness.
A channel-only HTTP 503 can complete with a warning when the detailed /readyz
response explicitly reports coreReady: true; ordinary service-start checks
still require full readiness.
Plugin activation or load failures remain named warnings
when these core checks pass; they do not turn a successful core update into an error.
Channel probe errors, timeouts, and stopped or suppressed channels become named
warnings after core verification succeeds. Run openclaw channels status --probe
or openclaw health --json to diagnose them; they do not prevent verified package
backup retirement.
Managed updates from 2026.9.3 can finish migration through the new runtime while the original updater retains installation ownership. The new runtime checks the captured update identity against its live parent before finalizing either a Git or npm installation. This continuation does not change the recovery limits below.
The new version can be running while verification fails. Recovery guidance uses the latest observed service state and names the running version when known; an earlier activation stop does not mean the service remains stopped.
If update recovery finds its managed service still stopped, an unverified service
definition or installer backup receipt does not prohibit starting the installed
runtime. The updater preserves the existing definition, revalidates service
ownership, restarts through the service owner, and verifies normal readiness.
Successful recovery completes with a warning and retains package backups for
openclaw update repair. Failed startup reports its concrete error and directs
you to openclaw update repair and openclaw gateway status --deep.
A named data risk, such as unverified migrated state, is reported as unverified:
the report states whether the Gateway is running or stopped and which version is
installed, and names openclaw update repair, which checks the state before it
starts the Gateway (see
Recorded data risk).
Unsettled Doctor writers still require you to stop the recorded processes first.
On Windows, recovery re-enables the Scheduled Task before starting the Gateway and retains that recovery handle until final readiness verification completes. Re-enabling autostart alone does not count as a Gateway start. This also applies when post-update verification fails during a same-version npm reinstall. The running updater must contain this fix; installing a newer candidate cannot change an older updater's recovery orchestration.
Respawn and update verification use the same progress-aware readiness wait as
Gateway restart. Startup that continues making progress can use the existing
five-minute startup lease. If that lease ends while the same Gateway is still
progressing, verification finishes with a warning and reason still-starting.
The process stays running, recovery backups remain available, and the updater
does not restart it again, roll it back, or instruct you to keep it stopped.
Direct updater verification reports skipped because readiness is unverified.
For a foreground RPC handoff, the replacement Gateway retains final verification:
the run stays pending and its continuation is preserved until startup verification
settles. A version that has not yet been observed is unknown; a version mismatch
requires an observed serving version that disagrees with the installed target.
When the readiness allowance expires for a running Gateway while the restart
owner reports waiting for a listener or startup migration, the updater records
the elapsed wait and startup phase as a warning. It leaves the process starting, keeps readiness
unconfirmed, and retains recovery backups. The run ends skipped with reason
gateway-readiness-unverified, recording an intentional unverified outcome rather
than success or an indefinite pending run. A PID or boot-generation change alone
does not fail this wait; current health, version, build, and listener checks still
apply. Check openclaw gateway status --deep
before retiring those backups. A timeout alone does not authorize a recovery
restart or rollback; a refused rollback also leaves the candidate untouched.
A running status alone, a failed check on an established listener, or an HTTP
/readyz failure does not establish startup progress. Those unhealthy-service
observations and concrete version, build, or stopped-service failures
remain failures with their own diagnostics. Doctor reports a qualifying startup
timeout explicitly as gateway-readiness-unverified, including after migrated
finalization, and tells the operator that readiness remains unconfirmed.
This warning handling belongs to the updater already running. The published 2026.9.3 and 2026.9.4 parents cannot distinguish pending readiness from verified success when completing a migrated update, so candidate-only updates cannot change their backup-retirement and Windows autostart decisions. The published 2026.9.4 runtime also retains its own ten-second respawn health wait when it verifies a child it started. Installing a new version cannot change that already-running wait. The shared respawn readiness wait applies when the new runtime owns the respawn, including subsequent upgrades driven by it; candidate-side restart verification uses the new owner when the old updater hands that work to the installed runtime.
Plugin packages download and sync against the installed target before the managed Gateway restarts. The service remains stopped through channel/config writes, plugin convergence, and any required full Doctor migrations. Downloads therefore count toward downtime. Unchanged plugins use read-only validation and readiness checks without another full Doctor pass. Service ownership is revalidated after convergence, and final runtime verification checks the resulting snapshot.
On Windows, Scheduled Task autostart stays suspended until the candidate finalizer
activates the updated Gateway. After migration, the retained updater checks its
live executor lease without reopening the newer state database. Plugin version
drift remains a warning while the candidate completes activation. This handoff
repair applies when the updated driver runs the next upgrade; it cannot change
an already-running 2026.9.5 updater. If that older driver stops with recovery
pending, use the installed version's openclaw update repair.
If you interrupt while Windows task autostart is initially being suspended, the updater restores its prior autostart setting before exiting. Restoration still requires the original live update owner and task identity. This interruption handling belongs to the updater already running; an in-progress older updater keeps its existing behavior.
When Doctor cannot acquire maintenance before repair writes begin, finalization
restores any service it stopped and exits successfully with a recorded warning.
This includes lock contention from unknown or non-serving processes. Doctor and
plugin convergence remain pending; resolve the named refusal and run
openclaw update repair again. Deferred finalization does not acknowledge earlier
interrupted updates or mark pending migrations complete. A live or unverified Gateway, active migration writes,
unreadable state, incomplete migrations, and unsettled cleanup still fail rather
than releasing their recovery obligations.
This behavior lives in the installed finalizer, so published updaters can use it
when they invoke the new version's update finalize. Older parents may omit the
warning from their own summary; the finalizer prints it and records it in update
history.
Owed steps
Some follow-up steps are not needed for the new version to run. When one of them
fails and the update otherwise succeeds, the update records the step as owed,
with its reason, prints it as a warning, and exits 0. In --json output the
warning is an advisory step, and the run record lists the owed step. Four steps
can be owed:
- Shell completion refresh (
shell-completion): the completion cache or the shell profile could not be refreshed after a core update. - Gateway service definition refresh (
service-definition): the service installer failed and the update continued on the previous definition, or the definition still points outside the updated installation after the refresh. - Plugin convergence (
plugin-convergence): during a core update, plugin sync, update, or repair threw before it published any plugin record or config change. The updater restores every plugin package it replaced in that pass, so plugins stay on their previous versions and records. The update then validates the final config, runs readiness checks, and starts the Gateway as usual. - Post-plugin Doctor (
post-plugin-doctor): Doctor started after plugin convergence, and the updater then failed around it for a reason Doctor did not report, such as a state read that failed after Doctor finished. Config validation and readiness checks still run before the Gateway starts.
Required database migrations, refused or invalid configuration, Doctor refusals, and Gateway readiness are never owed. They still block completion. A failed or rolled-back update owes nothing, including a step recorded before it failed.
When plugin convergence changes no config, the updater publishes the plugin
install records without writing the config file. The file keeps its bytes,
including its meta.lastTouchedVersion stamp, and a config file the update
cannot replace, such as a link to a provisioned read-only file, cannot fail
that publication. Other writes in the same update, such as a requested channel
change or a Doctor repair, still need a writable config. Plugin convergence
that does change config needs a config write too, and a refused write still
fails the update.
A plugin or Doctor failure is owed only when the updater can show what it left behind. These failures still fail the command, and roll back a replaced core:
- plugin convergence that throws where plugin installs are not restored
together: on an already-current core, in
openclaw update repair, and in an update whose updater did not retain the plugin set before activation - plugin convergence that throws while it must also restore channel config that Doctor dropped during this update
- a refused config write, or an unexpected failure while plugin records and config are being published
- a package that could not be restored after a failed plugin install
- a post-core update process that exits nonzero, is terminated, or times out
- a Doctor refusal: a migration or config-write refusal, a cancelled Doctor, and any refusal that names data at risk
- a missing updated entrypoint, a Gateway that could not be parked for Doctor, or a state read that fails before Doctor starts
- a command whose termination cannot be confirmed, and lost update authority
Later commands settle what is owed:
- The next
openclaw updaterefreshes shell completion again, including when the core is already current, where it does not prompt. A shell profile that still loads completion the slow way keeps the step owed until an interactive update oropenclaw completion --installupgrades it. - An update settles an owed service definition refresh only when it refreshes the service definition itself, as a core update with a restart does. Otherwise the step stays owed and the update repeats the warning.
- The next
openclaw updateruns plugin convergence again, including when the core is already current, and settles the step when convergence completes. Individual plugins that fail to update are reported as plugin warnings, as before, and do not keep the step owed. Convergence that is deferred because config changed during the update settles nothing: every plugin step stays owed. Convergence that throws again during a core update is owed again for the new reason. On an already-current core it fails the command as before, and the step stays owed. - An update settles an owed post-plugin Doctor only when it changes plugins and its own Doctor then completes. An update that leaves plugins unchanged does not run full Doctor, so the step stays owed and the update repeats the warning.
openclaw update repairrefreshes the completion cache when it runs finalization. It does not run the service installer. After its Doctor maintenance, it settles the service definition step when the managed definition targets the active installation, or when no managed service remains. Repair runs full Doctor and then plugin convergence, so it settles the post-plugin Doctor step, and settles plugin convergence when its own convergence completes. A repair that finds a healthy Gateway and skips finalization leaves owed steps unchanged.
A retry that fails keeps the step owed and warns again. It does not fail the command, except for the plugin convergence cases above. The command that retried it then holds the step in its own run. Gateway startup does not retry owed steps. With automatic updates on, a Gateway whose core is current can retry owed plugin convergence once through an update campaign; see Automatic updates. See Status and history to inspect them.
An updater records and retries owed steps only when its own version supports them. On the first update to a version that does, the previously installed updater runs these steps and still drops a failed shell completion refresh without a record. It records no plugin step either. Plugin convergence runs in the new version's own process, which keeps that first update only when the previously installed updater retained the plugin set before activation, and otherwise fails as before. A convergence that changes no config writes no config file, so its plugin publication does not fail on a config the update cannot write. The post-plugin Doctor pass behaves as it did in the previously installed updater whenever that updater runs the pass itself.
Recovery limits
Package updates capture verified SQLite backups before live Doctor migrations.
The shared database and every discovered agent database are saved beside the
retained package in <package-backup>.databases. To identify a copy after detailed
run history is compacted, look up its relative filename (for example, payload/0.sqlite)
in that directory's sources.json. The value is the original absolute database path.
Older backups encode that path in the snapshot's directory names. The report retains the directory location;
per-file paths, schema versions, and digests appear in bounded diagnostics. Committed WAL data is included in each
standalone snapshot. The snapshot needs what it writes: the total SQLite family
bytes, plus the larger of one family of private staging during capture and, on
the database volume, room for the migration that follows (the largest database
plus 64 MiB). Restoration checks its own space when it runs, before it moves any
live database, so the snapshot reserves nothing for it.
A snapshot that the backup measures as not fitting never stops the update. The
updater skips it before copying anything, records a database snapshot warning
that names the space needed and free, and continues. Each schema migration
commits in one SQLite transaction with its version bump, so an interrupted or
failed migration loses nothing. What a skipped snapshot gives up is going back:
once the new version's migration commits, the previous version refuses the newer
schema, so a failed update stays on the new version and is fixed forward. Any
other snapshot failure, including a disk that fills while a copy is running,
still fails the update before migration. Unknown free space produces a warning
and the snapshot is attempted.
The update refuses before it changes anything only when the database volume cannot hold the migration itself: the largest database plus 64 MiB, because a schema migration's write-ahead log holds about one copy of each rewritten page (measured: 685 MB of log for a shared database of about 0.7 GB). The refusal names how much to free. Git release updates take no database snapshot; an install already serving from a release runs no snapshot check, and its databases migrate when the new Gateway starts. Hard-linked database or journal files refuse before migration because restoring one pathname cannot safely restore every alias.
Backup metadata reuses the snapshot publisher's verified SHA-256 and byte count, avoiding another full database read. Recovery still verifies the stored bytes against that receipt before replacing any live database, so later snapshot changes are rejected. This saving requires the installed updater to contain the fix; older updaters retain their original backup path.
The native supervisor's update migrate --backup-root capture runs with the
Gateway stopped. Checkpointed database files use filesystem clones when available
(including APFS and reflink-capable Linux filesystems), with an independent byte
copy on other filesystems. The capture checks the SQLite header/schema, records
one SHA-256 digest for the existing restore contract, and verifies that source
files and journal state stayed unchanged. Clone creation avoids copying payload
pages, but the required digest still reads each snapshot once. Retained WAL or
rollback journals use the existing coherent, fully verified snapshot path.
Every discovered agent database remains covered even during a shared-state-only
schema upgrade: Doctor can write agent bookkeeping without advancing its schema.
Update-time Doctor defers media content maintenance on databases whose schema is
already current; explicit openclaw doctor --fix still performs that maintenance.
Databases needing schema repair or carrying recorded corruption retain the repair
path. This avoids repeated backup integrity audits and unnecessary writable opens
while the service is stopped; startup validation retains its own policy.
Settled, verified successful activation removes the current update's database snapshots only while automatic restoration remains available, together with the old package backup. Rollback, failed or unverified completion, and restore refusal (including refusal recorded after Doctor runs) keep the snapshots. Cleanup failures produce a maintenance warning with the retained path. Older snapshot directories remain untouched because their ownership and successful outcome cannot be proven from existing receipts; Doctor reports older npm snapshot directories with their size and removal command. Confirm no update is in progress and inspect their update reports and recovery state before removing them manually.
If the Gateway was confirmed stopped during capture and the update fails before the candidate is allowed to start, restoration also requires matching database write evidence. Doctor checks the captured file generations before migrations and records their final generations before releasing maintenance ownership. Any fingerprint change during maintenance, including a newly created database, refuses automatic restoration. Gateway maintenance ownership does not exclude independent SQLite writers, and these observations cannot distinguish Doctor's own writes from foreign commits. Changed databases require manual recovery. Rollback checks those facts again while holding database file exclusions. The fingerprints cover database identity, committed page content, and the retained WAL transaction counter and commit checksum; they reuse the snapshot inventory. Checkpointing already-captured WAL pages into the same database does not invalidate rollback while that write evidence remains available. New commits, replacement of a database, or loss of the captured WAL write evidence still refuse restoration. An exact write reversal that leaves both committed bytes and retained write evidence unchanged is admitted: it leaves no later data for rollback to discard.
When that evidence matches, the updater restores the databases before restoring
the package. It holds the
Gateway lifecycle and database file exclusions, moves migrated files to
<database>.migrated-<runId> (with matching WAL/SHM/journal suffixes), and publishes
the verified snapshots to the vacant paths. Both snapshots and displaced files
remain available for manual recovery; their locations appear in the report.
If package or config restoration is then refused, the Gateway stays stopped and
both database generations remain available for manual recovery.
An attempted candidate start, uncertain child termination, unavailable file
exclusion, or delegated Windows autostart custody prevents silent restoration.
Those cases retain the existing recovery refusal and its next action.
Unaccounted changes report state-migrated-no-rollback, preserve
the current databases, and name the retained snapshot directory and openclaw doctor
recovery step. A change before Doctor starts also prevents restoration. The
comparison cannot identify the writer: later update-history writes can also
invalidate the evidence. Continuous custody across Doctor subprocesses is not
provided by this check.
If Doctor cannot provide write evidence, rollback requires the last verified
database generations to remain unchanged.
Snapshots taken while a Gateway may still be writing, including with
--no-restart, remain available for manual recovery with a warning even after verified
successful activation. They never
become eligible for automatic restoration just because that Gateway later exits.
This protection belongs to the updater already running. Installing it does not retrofit the 2026.9.1 or 2026.9.5 driver; it protects subsequent package updates run by the repaired driver. It does not replay older full-state checkpoint records or replace independent backups. Private snapshots used for validation are disposable rehearsal copies. Before a significant update, create an independent verified backup.
Unknown or changed schema/configuration does not authorize a restore. When compatibility cannot be established, the updater refuses rollback, preserves state and retained package material, and reports the failed operation. Restoring an older package alone is not proof that the service can safely start.
Existing pending records that require checkpoint replay are unsupported by this
update path. openclaw update reports them before ordinary mutable update work;
it does not replay, rewrite, retire, or clear their retained state. update finalize does not bypass that refusal. Preserve the records and any named
recovery artifacts for recovery with a compatible implementation or a verified
backup. A later invocation must not label an unresolved interrupted run successful.
Compatibility-checked package rollback
The previous package tree remains available until activation or package restoration
is verified. If activation fails before a working package is confirmed and rollback
cannot be verified, finalization retains the backup and reports its location. Keep
that backup and repair the installation before restarting, including for older
targets without migration continuation. Automatic rollback requires that retained package, its pre-update verification, unchanged
config content since the activation Doctor pass, and compatible pre-existing shared and affected per-agent
SQLite user_version values, including databases restored by the pre-start recovery above. A database first created during activation or
verification is schema-neutral only at the schema version supported by the new installation
for that database kind; a missing pre-existing database or a new database at a foreign
version blocks rollback. Newly created databases must also be readable by the
previous package; unknown or incompatible support refuses rollback with
rollback-state-unverified. The updater restores the previous generation and verifies
it running before finishing rolled-back, preserving the failing check as its
reason. See Automatic rollback
for the restoration and package-manager guards. The new version’s own Doctor
migrations in the main config file do not block rollback, including on a fresh
install’s first update. Separate $include files must retain their pre-activation
configuration content. Doctor must have consumed the captured pre-update config,
and the current file must match its reported output. Restoration holds the normal config writer lock and
rechecks the captured hash before writing.
When needed, rollback replaces the main config with the exact bytes captured before
Doctor and owner-only permissions (0600), including the previous writer stamp.
Operator edits made after activation block
restoration, including edits before Doctor reads the config or after its last write; the next action names the changed config file. A failure alone does not
authorize restarting the new version.
If the config file changed after the activation Doctor pass or migrated databases
cannot be safely restored before candidate startup, automatic rollback is refused with
state-migrated-no-rollback. The updater preserves the failed outcome and migrated state. If rollback
itself fails, it retains the package and service recovery diagnostics. Optional
post-failure Triage starts only after update ownership and service
compensation settle; it does not rewrite the failed update or grant new restart
authority. These temporary validation snapshots are not a full-state backup;
see Rollback.
If schema state cannot be verified after a new-version Doctor or boot check may have
written it, rollback is refused with rollback-state-unverified; unknown state never
counts as schema-neutral. Before any new-version process opened state (for example a Git
release switch, where the previous Gateway keeps serving), an unreadable store is a
recorded warning, not data at risk, and the update continues.
If an update fails before activation, recovery observes the existing Gateway once without waiting for startup or restarting it. Native service and listener checks share the update's existing observation allowance; their elapsed time does not consume the separate short health-request timeout. An explicit shorter check allowance and the overall deadline still apply. This correction takes effect when the installed updater includes it, not in an older updater already running.
Restart handoff
Service-manager commands and helper acknowledgements share the activation or recovery allowance. Slow inspection or teardown does not impose a separate five- or thirty-second command cutoff. Service installation also forwards one caller budget through installation and activation; the parent owns cancellation.
When an agent runs openclaw update inside a systemd user service or macOS
LaunchAgent Gateway, the CLI hands the update to the same managed-service helper
before stopping the Gateway. It prints the helper log path and follow-up commands
for update status and Gateway health, then exits; this acknowledges the handoff,
not a completed update. The acknowledging CLI exits with code 75 (EX_TEMPFAIL)
so scripts cannot mistake accepted background work for a completed update. The
detached helper remains the settlement authority; use the printed status and
health commands to retrieve its terminal result. A handoff accepted during candidate
admission keeps this pending result after local staging cleanup; it does not create
an update failure report. The helper launches staging and validation outside the
Gateway's service boundary while the old Gateway keeps serving. It parks the Gateway
only when the orchestrator reaches activating, then completes the existing
commit-or-cancel handoff. Keep stdout connected to the agent: stopping the service
can terminate the surrounding exec shell (SIGTERM or exit 143), including commands
chained after the update. After a handoff result, use the printed follow-up commands
for the final outcome. Plain terminal updates remain synchronous, and --no-restart
does not authorize stopping the agent's Gateway.
Post-core steps follow the verified replacement package, including pnpm updates that change the target of the global package link. The helper retains the original installation identity for recovery; a child running from a different installation is still rejected.
Updates from stable 2026.9.2 and 2026.9.3 retain support for their service handoff records, which predate the recorded Linux service-manager UID. The new version still revalidates service ownership, profile, unit, and protected launcher data. When the handoff records a manager UID, a different UID blocks service mutation.
The Gateway core auto-updater requires a managed service restart path. It hands
the CLI update to a detached helper before activation. A foreground
Gateway keeps update hints but leaves installation and activation to the
operator: stop it, run openclaw update, then launch it again.
Control-plane update.run uses the same detached CLI update owner for
package-manager and Git installations, including a verified foreground Gateway.
The Gateway stays available during validation. Before replacing its installed
code, the updater asks that exact Gateway to drain work and close its services,
databases, and listener. A foreground Gateway launches a fresh process only after
the updater settles; it does not reopen its old module graph after replacement.
Managed services restart through their existing service manager. Android
(Termux) verifies a foreground Gateway with the same Linux kernel process and
boot identities as Linux.
Chat updates retain the requester's original person-access grant while staging and validation run. Revoking that grant stops the pending update and leaves the Gateway serving; issuing a new grant does not revive the original request. Before parking, the Gateway must confirm that the original grant and current admin authority still permit the update. A missing, failed, or timed-out confirmation does not authorize stopping the Gateway.
After parking is authorized, the native updater owns completion or recovery of that same update, including Doctor and restart verification. Closing the original Gateway's access-policy service during shutdown does not cancel this accepted operation. The original profile link, role, configured authority, installation ownership, and config-write checks still apply. A new update or triage request requires fresh authorization.
With OPENCLAW_NO_RESPAWN enabled, a foreground Gateway refuses update.run
before starting the updater. Stop the Gateway, run openclaw update, and start
it again, or relaunch it without OPENCLAW_NO_RESPAWN to allow control-plane updates.
Each requested update checks the current local installation and Git upstream before accepting its target. Git updates build a detached release worktree; they do not detach the source checkout. Startup status discovery does not freeze later update requests.
A foreground replacement can still be starting when the initial readiness
observation ends. OpenClaw leaves that process running and reports readiness as
unverified. Use openclaw gateway status --deep to check its progress.
Successful updates remain pending until the replacement verifies startup.
If readiness rejects a foreground replacement, OpenClaw requests a graceful shutdown and reports shutdown as pending with the replacement PID. The old Gateway process waits for that replacement to close. If shutdown does not finish, inspect the replacement's startup logs and active updates before stopping it manually.
Stopping a foreground Gateway during helper startup, package staging, or activation waits for owned update work to finish, then leaves the Gateway stopped. New updates and unrelated restarts cannot bypass that wait. If cleanup ownership is uncertain, the Gateway remains draining; after checking the updater, send Stop again to recheck the same work. A replacement already starting is also stopped. Pending startup verification runs on the next Gateway start. The previous package backup remains available while that verification is pending.
Stored extended-stable selections receive read-only startup and 24-hour update
hints when update.checkOnStart is enabled. These checks never apply an update,
start a handoff, restart the Gateway, use stable delay/jitter, or use beta
polling cadence. Explicit foreground updates, bare foreground updates with
stored update.channel: "extended-stable", on-demand status, and their managed
Gateway handoff remain supported.
Update validation and service definitions
Before restarting a writable managed service, update finalization uses the shared service audit and native installer to repair recognized stale policy. It backs up the definition, preserves supported custom settings, and records changed keys and backup paths in update warnings. Unknown operator edits remain unchanged. Update-time Doctor reports drift and leaves this rewrite to finalization.
Candidate-owned rollback restores the verified definition backup before running the previous installer's recovery. When an older published updater owns rollback, that release's installer regenerates the definition with the settings it supports; the retained backup records the original bytes.
With a local managed service and restart enabled, update validation precedes
the stop as described above. The updater reports Gateway: restarted and verified.
only after the restarted service passes verification. Plugin-owned readiness
checks run against an isolated state snapshot and do not run interactive setup,
download models, or change config. Readiness owners are selected before their
health APIs load, so unrelated optional Doctor checks cannot interrupt the gate.
Selected checks remain mandatory, including when a required artifact is missing.
Code updates do not require permission to rewrite the native service definition.
On Linux, sealed or unverified definition-write authority skips metadata refresh,
even when metadata is stale. An inspectable service owned by the updated install
still uses its native manager for restart and health/version verification.
Activation runs the updated CLI with gateway restart --preserve-definition so
its own version guards apply and automatic repair stays disabled. If the target
CLI does not support that option, it rejects activation before repair. The code
update stays installed, but the command exits nonzero with the activation error
(on stderr in JSON mode). A service stopped for the update may remain stopped.
Run openclaw gateway status --deep and ask the deployment owner to restart it
through its native manager or repair stale metadata; do not retry without the
preservation option unless definition repair is intended.
Shell installers
Shell installers do not establish the same service ownership proof. If their service refresh is denied, they report code installation success, leave the service untouched, and print guidance to inspect ownership and restart manually.
Linux without a service manager
On Linux without a service manager, updates proceed when native inspection proves the service is absent and the selected Gateway has no active lock or listener. The command reports that there is no Gateway to restart.
If service inspection is unavailable or installation ownership is unresolved,
the update continues with a warning and leaves the recorded service unchanged.
An unverified record cannot select the update's package, Node runtime,
configuration, or state directory. Restart the Gateway you launched manually
after the update, and use openclaw gateway status --deep to inspect the record.
Verified services still select their own installation and state directory;
ownership conflicts, pending recovery, and active state writers retain their
existing admission checks. Services owned by another install remain untouched.
The published 2026.8.2 CLI also refuses updates on service-less Linux installs.
Use openclaw update --no-restart for that upgrade after confirming that no Gateway
is running; the new CLI cannot fix the old CLI's pre-update inspection.
Node runtime for package-manager updates
Package-manager updates normally keep using the Node binary recorded in the managed service. If that Node cannot run the target release, the update refuses before staging the package or migrating state, even when the current CLI Node is compatible and restart is enabled. The diagnostic names the service Node path, its version, the required range, and the recovery steps. Changing the shell's Node alone does not change an absolute Node path in the service unit.
For an installation already updated with an unsupported service Node, run
openclaw doctor --fix under a supported Node. Doctor can refresh the runtime
of a verified owned service, keeping a backup and preserving native settings
and unrelated systemd drop-ins. This includes a drop-in whose
EnvironmentFile=-%t/... supplies unrelated environment variables. A drop-in
that overrides the launcher or PATH must be repaired by its owner; Doctor
leaves it unchanged and identifies the unit to inspect with systemctl --user cat.
Explicit saved runtime pins remain operator choices. To replace an unsupported
pin, run openclaw gateway install --force --runtime node --runtime-path /path/to/supported/node
from the intended installation and profile. Preserve operator overrides; the
installer cannot repair a conflicting drop-in by rewriting the base unit.
macOS LaunchAgent verification
On macOS, the post-update check also verifies the LaunchAgent is
loaded/running for the active profile and the configured loopback port is
healthy. If the plist is installed but launchd is not supervising it, OpenClaw
re-bootstraps the LaunchAgent automatically and reruns the health/version/
channel readiness checks (a fresh bootstrap loads the RunAtLoad job directly,
so recovery does not immediately kickstart -k the newly spawned Gateway).
When preserving a definition, native restart/bootstrap runs without file repair;
a failed native activation or health check does not trigger a later plist rewrite. If
the Gateway still does not become healthy, the command exits non-zero and
prints the restart log path plus restart, reinstall, and package rollback
instructions.
When restart is skipped or fails
If restart cannot run, the command prints Gateway: restart skipped (...) or
Gateway: restart failed: ... with guidance to inspect the service and restart manually.
With --no-restart, package replacement still runs, but the updater does not
stop or restart the Gateway. A package Gateway can still exit when it detects
that its installation was replaced; restart it through its service or foreground
process owner afterward. Git updates build a release and leave it pending for
the next service start. The serving release stays unchanged.
When updater-owned Doctor reaches maintenance before that foreground Gateway finishes shutting down, it waits for exclusive state ownership, up to the installation-check interval plus the existing restart-drain and service-stop allowances. Doctor retains the updater's live authority and still acquires its normal maintenance locks before repairing state. The same bounded wait applies if the owner exits or changes while Doctor waits; only acquiring the physical maintenance lock permits repair. Lost update authority or unresolved contention stops maintenance with recovery guidance. Ordinary Doctor commands and older update drivers without delegated Doctor authority retain their immediate refusal for a Gateway holder.
If another OpenClaw process that is not a Gateway holds state ownership when updater-run Doctor enters maintenance (for example a CLI or plugin command, an embedded agent run, or another Doctor), Doctor waits for it, with or without delegated Doctor authority. It prints which process and database it is waiting on and how long it will wait, repeats progress every 30 seconds, and continues once ownership is released. The wait holds no OpenClaw lock, so the other process can finish.
The wait leaves Doctor time to finish within the default 30-minute update step
allowance, counted from Doctor's own start. Installed updaters run activation
Doctor without a step timeout unless the update was started with --timeout, and
they don't pass that value to Doctor, so Doctor applies the default instead. It
reserves twice the time an older updater's migration rehearsal (candidate-doctor in
the update run) took, when one ran,
and at least 10 minutes (about twice the slowest measured update Doctor, 258 s on
1 CPU with 10 MB/s disk), and waits only until the rest is used. By default that
is up to 20 minutes, less the time Doctor already spent. All of Doctor's waits for
other processes draw from this one deadline, so an earlier wait shortens later
ones. An update started with a shorter --timeout can still time out while
Doctor waits.
If the holder is still running afterward, maintenance stops with the holder's PID
and the usual deferred-maintenance warning: let that process finish or stop it,
then run openclaw update repair. A holder whose role was not recorded is treated
as a Gateway. The wait is part of the new version's Doctor, so it applies to any
update to a release that contains it, regardless of the installed updater's
version. Manual openclaw doctor --fix keeps failing immediately so the operator
can decide.
The same wait covers another OpenClaw process that has an agent database open
without holding state ownership, such as a plugin command run while the Gateway is
stopped. Doctor releases state ownership while it waits, because that process must
write shared state to close its database. It prints the holder's PID and progress
every 30 seconds, then rechecks under maintenance ownership before repairing.
This includes activation Doctor run by published updaters, which select the
external service policy after stopping the Gateway themselves. A lease held by
Doctor's own process, or any lease while a Gateway still owns the state, still
refuses immediately. This wait ends at the same deadline as the state wait, so
time spent waiting for state ownership shortens it. If the database is still open
at the deadline, maintenance stops with the holder's PID and the usual
deferred-maintenance warning (agent-database-lease-active).
An unused agent database stays open only briefly in a CLI process: a CLI command, including a plugin command, closes it about 30 seconds after its last use, so Doctor's wait ends soon after that process goes idle. The Gateway keeps unused databases open for up to 30 minutes and closes them when it stops. A process that is still reading or writing keeps its database open until the work finishes. Processes started from a release without this change keep their unused databases open for up to 30 minutes, which can outlast the wait; stop them before updating.
An active Gateway suspension keeps installation changes under its host operation’s control. The installation watcher does not independently restart the Gateway while suspension is preparing, draining, or prepared. After resume or lease expiry, its next check reads the current installation again; a pointer restored during rollback does not leave a stale replacement verdict. Explicit stop and restart requests retain their existing behavior.
Published 2026.9.5 Gateways do not have an installation-replacement watcher.
Installing a newer candidate cannot add that behavior to the process already
running. For that first foreground update, stop the Gateway through its foreground
process owner and wait for it to exit, run openclaw update, then launch the
Gateway again. Keep the same installation, profile, and state/config overrides.
--no-restart does not authorize Doctor to stop that process or skip required
state maintenance.
If the package was already replaced and Doctor failed on the live Gateway lock,
wait for the updater to exit, stop the foreground Gateway through its owner, and
run openclaw update repair --yes --no-restart --json from the updated installation.
Verify the repair result before starting the Gateway again. Preserve the existing
state and recovery backups; replacing files alone does not complete maintenance.
Control-plane response shape
When update.run runs through the Gateway control plane on a package-manager
install or supervised git checkout, the handler reports handoff initiation
separately from the CLI update that continues in the detached helper:
ok: true,result.status: "skipped",result.reason: "managed-service-handoff-started", andhandoff.status: "started": the Gateway created the managed-service handoff so the detached helper can runopenclaw update --yes --jsonoutside the live service process. The old Gateway stays available during validation; this response does not mean the service has stopped or the update has completed.ok: false,result.reason: "managed-service-handoff-unavailable", andhandoff.status: "unavailable": OpenClaw could not find a supervising service boundary and durable service identity for a safe handoff (for example, systemd handoff requires theOPENCLAW_SYSTEMD_UNITunit identity, not just ambient systemd process markers). The response includeshandoff.command, the shell command to run from outside the Gateway.ok: false,result.reason: "managed-service-handoff-failed": the Gateway tried to create the handoff but could not spawn the detached helper.
The sentinel payload is written before the Gateway exits, and the CLI
handoff updates that same restart sentinel after the managed-service restart
health checks complete. During the handoff, the sentinel can carry
stats.reason: "restart-health-pending" with no success continuation; the
restarted Gateway polls it and fires the continuation only after the CLI has
verified service health and rewritten the sentinel with the final ok result.
openclaw status and openclaw status --all show an Update restart row
while that sentinel is pending or failed. update.status retains the latest
sentinel and also returns the durable run record. The sentinel carries
stats.runId; the run record remains available after notice delivery consumes
the sentinel.
Git checkout flow
Channel selection
stable: select the latest non-beta tag.beta: prefer the latest-betatag, falling back to the latest stable tag when beta is missing or older.dev: fetchmainand rebase the staged checkout.extended-stable: unsupported for Git checkouts; no checkout mutation occurs.
Update steps
Inspect the source and serving release
Resolves the source repository, checkout HEAD, and serving release's commit and runtime identity. It does not require a clean source checkout or overwrite its local edits. Candidate validation checks that the release worktree still matches its selected commit.
Resolve the target
Selects the channel's tag or branch and fetches upstream as needed.
A verified running release can report skipped with reason already-current when its source already matches the target. After a build, the runner also compares the candidate and running commit trees. Equal trees are already current only when the running runtime verifies. This handles local commit replay that changes commit IDs without changing source. Conversion to releases first builds the currently serving commit as a fallback, even when the target is current.
Dev updates fetch only the configured tracking remote for main, or the remote identified by an explicit tracked target. Unrelated remotes remain untouched, with a scope warning in update history; their availability cannot fail the update. When no local main exists, or an explicit commit or tag needs discovery, candidate remotes may be tried. Failed optional attempts are warnings, and stale refs from failed fetches cannot select a branch. A failed fetch from the configured authority still reports fetch-failed before activation. Fetching does not rewrite Git configuration.
Update Git fetches and transactional clones retry transient transport failures (including EOF, connection resets, timeouts, and HTTP 5xx) after 1, 5, and 15 seconds, for at most four attempts. Remote-ref probes and dry runs retain one retry. All attempts share the original explicit timeout budget; omitted fetch deadlines remain unbounded. A failed clone is cleaned before a new attempt; uncertain cleanup stops retries with a warning. Cancellation, authentication, certificate, integrity, and ref-lock failures are not retried. Each retry logs a warning. This behavior belongs to the installed updater, so an older updater may still need a manual retry to obtain the fix.
An explicit detached full commit ID already present locally skips optional remote discovery. This does not skip candidate validation or promise an offline update: missing tree/blob objects in partial clones are still hydrated privately before activation. Symbolic and tracked targets retain their remote freshness and ancestry checks.
Fetch behavior belongs to the updater already running. An older updater may still fail before candidate code executes. For that first hop, use Git's process-only remote.<name>.skipFetchAll=true override for the unrelated remote, or update through the installation's manual method; no persistent Git config change is needed.
Shallow and partial source checkouts retain their installed refs, shallow boundaries, and object database during target inspection. Missing objects are fetched into the private inspection repository through the checkout's configured remotes. This behavior belongs to the installed updater; an older updater that fails with Git target inspection clone failed needs its checkout's missing objects fetched before retrying.
Build the update
Stable, beta, and dev updates install dependencies and build a detached release worktree while the old Gateway serves. Dev rebases the candidate first so local commits are preserved in the release. The source checkout's branch, files, and built runtime stay unchanged. Only dev updates walk back through earlier commits; stable and beta validate their selected tag.
Dev skips local commit replay with a warning when shallow boundaries or unrelated history hide a shared ancestor with the target. Optional local checkout and rebase each have a ten-minute deadline, shortened by an explicit --timeout. If replay times out, that candidate is validated without local replay; conflicts retain the existing walk back through older candidates, and interruption stops the attempt.
Releases live at <state>/git-install/releases/<id>/openclaw. Each release is built and checked at that path, so the update validates the tree the Gateway serves from. The updater does not import a candidate pack into the checkout or copy the built runtime over its files.
When switching a package installation to Git, the updater clones the source checkout and builds its first release from it. The global npm package's openclaw.mjs then starts the release link's CLI.
On Windows, the release link is an NTFS junction, which needs no administrator rights.
Dev can walk back up to 10 commits to find the newest buildable version. Confirmed ENOSPC storage failures stop immediately with preflight-insufficient-space; free space on the preflight staging and package-manager store filesystems before retrying. Shared package-manager stores are not deleted. Update builds skip TypeScript declaration generation by default. Set OPENCLAW_RUN_NODE_SKIP_DTS_BUILD=0 to explicitly request declarations. Set OPENCLAW_UPDATE_PREFLIGHT_LINT=1 to also run source lint during this preflight; lint runs in constrained serial mode because user update hosts are often smaller than CI runners.
The installed updater owns this flow. Installing candidate code cannot change an older updater's staging or activation behavior on that first update.
Uses the repo package manager. For pnpm checkouts, the updater bootstraps pnpm on demand (via corepack first, then a temporary npm installation of the target checkout’s exact pnpm version) instead of running npm run build inside a pnpm workspace. If pnpm bootstrap still fails, the updater stops early with a package-manager-specific error instead of trying npm run build in the checkout.
Check the update
Runs Doctor health checks, config and plugin planning, and the isolated migration and test Gateway checks described above. Validation failure leaves the old Gateway serving. If validation leaves source edits in the temporary worktree, progress reports a failed candidate clean check.
Activate and verify
Checks that the service's Node can load the completed release with --version, then publishes it through <state>/git-install/openclaw. This is a symlink on POSIX and a junction on Windows. The service and the openclaw command on PATH both run through <state>/git-install/openclaw-launcher.mjs.
Windows cannot rename onto a junction, so a switch removes the old junction and then renames the new one into place. A process killed between those two steps leaves no git-install\openclaw; the temporary .openclaw.release-link-* junction beside it still names the new release. The next start through the launcher renames it into place, and the next openclaw update recreates a missing link.
Publication selects a release; it does not replace the running Gateway's files. The next Gateway start loads the selected release and upgrades state at boot. With --no-restart, publication leaves the old link selected and records the new release as pending for the next service start.
A normal release trial records Gateway starts. If the release fails to become ready twice, the launcher restores state files preserved by that trial's upgrade and switches the link back before the next start. A ready Gateway ends the trial. A deferred --no-restart start selects the pending release without this two-start fallback.
Activation captures the built commit and runtime content digest. At convergence completion, the update compares the runtime with that identity, including when finalization runs in the migrated candidate worker. A changed identity is a verification failure.
Recovery switches the release link. It does not restore checkout files, rewrite branch refs, or retain in-place runtime transaction directories.
Sync plugins
Against the installed target, syncs plugins to the active channel before restarting the managed service. Dev uses bundled plugins; stable and beta use npm or ClawHub while preserving recorded source choices. A changed plugin snapshot, pending plugin data/settings upgrade, or deferred model retirement recorded by this update runs fresh Doctor repairs. Unchanged plugins with no pending repair do not run another full Doctor pass. The updater then revalidates the service owner, starts the Gateway, and verifies the final snapshot.
If plugin data/settings upgrades remain pending after Doctor, the update records a warning naming each plugin and its recovery command, such as openclaw doctor --fix. Doctor-only and after-session repairs keep their existing offline ownership requirements; pending work does not by itself fail the core update. Skipped plugin updates also print the plugin name and skip reason alongside the summary counts.
The updater performing plugin convergence owns this deferred-repair decision. Package updates that delegate this work to the new version can use its repair immediately. If an older updater leaves model retirement deferred, run the newly installed openclaw doctor --fix once to finish it. Later updates use their own run history to complete the follow-up; they do not use another update's pending marker.
Source targets that support runtime completion also check their generated plugin runtime overlay and SDK aliases before loading plugin configuration. This completes artifacts omitted by an older updater on the first update to such a target; update repair performs the same check before Doctor. Exact artifacts remain untouched, including while a Gateway is running. Replacing missing or stale artifacts requires proof that the selected Gateway's affected runtime is offline. Before publication and each subsequent write, completion also checks discovered managed Gateways and refuses any observed live sibling using overlapping output paths. Stop that sibling through its own service manager or Startup process before retrying. A Gateway serving a physically separate runtime does not block completion. If the selected service's ownership or offline status cannot be verified, completion fails with recovery guidance instead of reporting a successful update. Older targets retain their existing generation behavior. Clean-source and staged-build validation still apply.
Git checkouts that run from releases
On every platform, a Git checkout runs from releases instead of being rebuilt in place,
with or without a Gateway service. Each release is a detached worktree of the
checkout under <stateDir>/git-install/releases/, and the link
<stateDir>/git-install/openclaw names the selected one. An update
builds the target as a new release, switches the link, and arms a trial in
releases/.trial. The service and the openclaw command on PATH start through
<stateDir>/git-install/openclaw-launcher.mjs. Only a Gateway run (openclaw gateway or
openclaw gateway run, without --help or --version) counts as a start: after two failed
starts the launcher switches the link back to the trial's previous release. With --no-restart,
the new release stays pending and the next Gateway run selects it. A service that still starts the
source checkout (the first update to releases) gets a definition that starts the launcher, written
without starting or restarting the Gateway, so its next start selects the release too. Only if that
write fails does the update record an owed service-definition step. The trial ends once the
Gateway on the new release is ready.
The launcher knows only its own state directory. A Gateway run for another profile started
through the same openclaw on PATH (openclaw --profile work gateway) also counts as a start of
this install: it selects this install's pending release, and two such failed runs during this
install's trial switch it back to its previous release.
If the old Gateway is still serving after its next maintenance check, the updater can
request a cooperative restart. A busy Gateway can defer that request for five minutes.
When the running Gateway records that it accepted a restart, the updater waits for
that deferral and process replacement before verifying. A signal alone does not extend
the wait. Older Gateways without this receipt keep the original bounded wait; an
explicit overall update timeout still applies. Only serving-build and readiness checks
confirm the update. This behavior requires the updated updater and, for the extended
wait, a running Gateway that records acceptance. If restart signals are disabled, an updater in an
independent terminal can still use the native restart of its verified, owned service.
A managed handoff never selects that route to restart a running incumbent. On macOS,
if a loaded KeepAlive job has no listener when verification times out, the updater
leaves the trial unconfirmed rather than restarting the job a second time: launchd
may still bring it up. Inspect openclaw gateway status --deep before taking action.
The link alone does not show what serves. An update can fail after the link switched
but before any Gateway started the new release. That leaves the link on a release that
never started, with its trial still armed. When the trial's previous release is shown to
serve (see below), the next plain openclaw update builds on it:
- If the target is the release the link already names, and that release's build still verifies, the update reuses it instead of rebuilding. It still admits the target and runs the normal candidate checks on it, and checks the match only after local commits are replayed. It then restarts the Gateway into the release, verifies it, and ends the trial.
- If the target is newer, the link goes back to the serving release. The new release
goes on trial with the serving release as its fallback. The superseded release stays
on disk, because an
openclawstarted through the link may be running from it; release collection in a later update that publishes a release removes it once it has been deselected for 24 hours. - If the serving release is the target, the update runs the candidate checks on it and the
caller's mutation check, puts the link back on the serving release, and reports that the
installation is current. If the placed release started or ended its trial meanwhile, the
link stays on it and the update fails with
git-release-selection-changedinstead. It does not call a restart safe, because the next start runs that other release.
Only a release the launcher never started and no process holds counts as never started.
A trial that started stays under the launcher, which owns its state rollback. If the
release starts, or its trial ends, while the update builds, the update does not reconcile
them: it publishes the target with the release the link names as its fallback. An update
with --no-restart does not repair a placed release, because moving the link would
restart a launcher-backed Gateway. It handles the link and trial as an earlier updater
would. A trial never falls back to its own target, and arming a trial for the release
the link already names keeps that release's existing trial.
The trial's previous release is used as the fallback, or its commit rebuilt, only on
evidence that this commit is what the Gateway serves. The only such evidence on disk is
the state a conversion leaves before its first restart: no Gateway has ever run from a
release, so the service still runs the checkout, and the checkout's own build reports
that commit. Every Gateway that runs from a release first takes a lease under
releases/.leases/, and that directory stays, so any lease directory there means the
checkout's build no longer shows what serves. Nothing on disk records that a release's
trial passed, and a lease is taken before the Gateway is ready, so neither shows which
release served. With that evidence, a fallback must be present, its build must verify
against its commit, and it must have the dist/index.js the launcher loads. If it is incomplete, the update rebuilds that commit as a new
release. It switches to the rebuilt release only at the normal switch point, after the
target passed its checks. A later attempt reuses that rebuild instead of building another
copy.
Without that evidence, or when the fallback is gone or no longer readable as a Git
release, the commit that serves is not known. The update then changes nothing and fails
with git-release-fallback-unavailable. Do not restart the Gateway into the release
link. Run openclaw triage so an agent can rebuild a fallback from the
serving commit, then run openclaw update again.
The link text is computed between real paths and must resolve to the chosen release before
the old link is replaced, so a state directory reached through a symlink (macOS /tmp is
/private/tmp) never gets a dangling link.
The update result includes a git-release-placement note that names the releases
involved and says what the update did. This runs in the installed updater, the
checkout's own build. An updater built before this change still treats the link's
release as the serving one.
Plugin sync details
On stable updates, a configured OpenClaw-owned official plugin with no install
record is repaired from the selected core release cohort. This also applies to
doctor --fix after an earlier upgrade lost a formerly bundled plugin. Post-core
reconciliation attempts installation before restart; an unavailable target remains
a named warning while the core update continues. Existing records keep their
registry and source choices. Verified official packages use the existing
capability-consent exemption.
Eligible managed release pins for npm and trusted official ClawHub installs of
@openclaw/* packages resume the catalog's default selector after a successful
update. The recorded selector must be an exact OpenClaw release no newer than the
installed core, and the same package must have a verified default catalog target.
This includes previously recorded automatic and manual pins. An explicit selector
supplied to the current plugin update command takes precedence. Pins outside that
eligibility, ranges, explicit tags, and other sources keep their existing policy.
Managed npm plugins on the beta channel select the newest version by semantic
version order from their beta and latest dist-tags, using the same policy as
the core updater. This includes official plugins with a default/latest catalog
target and managed @beta selectors. OpenClaw installs the exact inspected
version while keeping the selected tag or restored catalog default for future updates.
Npm plugin updates reuse the registry metadata already selected for the same installation attempt, avoiding a second lookup before download. Compatibility, integrity, install-policy, and capability-consent checks still apply to the selected package. A fallback to another target resolves that target separately.
ClawHub plugins on the beta channel try their own @beta tag. If that release
is unavailable, OpenClaw falls back to the default/latest spec and reports a
warning naming the requested and used targets.
Integrity, compatibility, trust, install-policy, and capability-consent failures
do not trigger fallback. Availability fallback warnings do not fail the core
update. Pins outside the managed release-pin recovery described above, ranges,
and explicit tags other than beta retain their selector.
Doctor can refresh a stale official runtime plugin that is bound to the current
OpenClaw release cohort. That repair stays on the recorded registry and verifies
the replacement artifact.
Already-current runtime plugins are kept in place; a no-op startup repair does
not reinstall the package or invalidate the migration checkpoint.
When post-core convergence retains an official pin outside automatic release-pin
recovery and the npm check finds a newer release, the update prints a pin advisory
and reports postUpdate.plugins.status: "warning" in JSON. The warning includes
the observed installed and available versions and an explicit command to replace
the pin. Keep the pin if intentional. This advisory does not establish
incompatibility, change the pin, or fail an otherwise successful core update.
An unavailable npm target or unreachable registry does not fail an otherwise
successful core update. When a compatible, runnable plugin is installed, plugin
sync retains that
installed version and its recorded selector. The summary, warning log, and run
history name the plugin, requested target, resolution failure, and
openclaw plugins update <id> next action. JSON keeps top-level status: "ok"
with a plugin-target-unavailable advisory under postUpdate.plugins.warnings.
Before mutation, OpenClaw checks installed compatibility metadata and skips
registry queries for compatible plugins. If a plugin's declared
openclaw.compat.pluginApi range or openclaw.install.minHostVersion excludes
the target core and a compatible replacement cannot be resolved, it records a
named notice and continues the core update. The plugin can remain unavailable
until a compatible version can be installed. Configuration, ownership, schema,
and core readiness checks still have to pass.
Older updaters may still refuse with plugin-target-unavailable before the new version’s
code runs. Use your installation's manual update method,
then run openclaw update repair from the updated installation.
If an exact pinned npm plugin update resolves to an artifact whose integrity differs from the stored install record, openclaw update aborts that plugin artifact update instead of installing it. Reinstall or update the plugin explicitly only after verifying you trust the new artifact.
Plugin-only availability, installation, and load failures are reported as named,
actionable warnings after an otherwise successful core update. JSON keeps
top-level status: "ok" and reports postUpdate.plugins.status: "warning".
Follow the command in postUpdate.plugins.warnings[].guidance. For a named
plugin, retry failed installs or updates with openclaw plugins update <id>;
use openclaw doctor --fix for load problems.
A failed plugin operation retains previous payloads and install records where
possible and preserves registry choices, plugin settings, enable/disable choices,
and active slots. A plugin can remain unavailable until repaired.
Plugin finalization re-reads config under the config write lock and retries
publication up to five times. It preserves unrelated edits and accepts changes
that are already applied. If a field being finalized conflicts with another edit,
or publication keeps racing another writer, finalization rolls back its pending
plugin transaction and records a warning with openclaw plugins doctor and
openclaw doctor --fix follow-up guidance. That warning does not fail the core
update or prevent Gateway recovery. The candidate must contain this repair;
older candidates retain their previous finalization behavior.
After installing the core and before restarting the managed Gateway,
openclaw update runs mandatory post-core convergence: it repairs missing
configured plugin payloads, validates each active tracked install record on disk,
and statically verifies its package.json contains a JSON object and its declared
openclaw.extensions entries are loadable. When a package does not declare
OpenClaw extensions, the check instead verifies any explicitly declared npm
main. Invalid package manifests and missing or unloadable plugin payloads add
per-plugin warnings while validation of the remaining plugins and the core update
continue. An invalid config snapshot still returns
postUpdate.plugins.status: "error", makes the top-level update status
"error", and exits nonzero. Invalid state, ownership errors, failed required
Doctor or readiness checks also remain errors. Disabled plugins are skipped unless their records are trusted official
sync targets. A changed plugin snapshot attempts fresh Doctor and, when restart
is requested, the Gateway restart and core runtime verification described above
before the run succeeds.
Post-plugin Doctor execution failures retain their exit reason and available
plugin diagnostics as warnings in the run record and openclaw update status.
If another step later fails, the generated failure report includes a sanitized
Warnings section. A throwing plugin config-repair hook preserves its input
and reports the plugin name and repair command. The core update can succeed with
these warnings; required state migrations, refused config writes, and unresolved
Doctor write custody still block completion.
When the updated Gateway starts, plugin loading is verify-only: startup does not run package managers or mutate dependency trees. Package-manager update.run restarts are handed to the CLI managed-service path, so the package swap happens outside the old Gateway process and the service health checks decide whether the update can be reported as complete.
After an extended-stable core update succeeds, post-core plugin integrity and
convergence target eligible official npm and trusted official ClawHub plugins at
the exact installed core version. For default/latest intent, OpenClaw does not
query plugin @extended-stable or fall back to npm latest; it derives the
package version from the installed core. Eligible managed release pins resume
the catalog default under the recovery rules above. Pins outside that eligibility,
explicit non-latest tags, third-party packages, custom ClawHub registries, and
other sources keep their existing intent. An explicit selector supplied for the
current plugin operation takes precedence.
Package-manager installs
For package-manager installs, openclaw update resolves the target package
version before invoking the package manager. npm global installs use a staged
install: OpenClaw installs the new package into a temporary npm prefix,
lets the staged package validate the host Node version during preinstall,
and verifies the packaged dist inventory there. A packed completion guard
stays outside that inventory until preinstall succeeds, so package managers
that skip lifecycle scripts also stop before activation. On npm 12 and newer,
the updater approves only the staged OpenClaw package’s lifecycle; transitive
dependency scripts remain blocked. OpenClaw then swaps the clean package tree
into the real global prefix. If verification fails, post-update doctor, plugin
sync, and restart work do not run from the suspect tree.
Staging uses a unique .openclaw.update-stage-* directory inside the target
global node_modules, separate from disposable npm rename leftovers. Each
attempt tries to remove only its own staging prefix; leftover cleanup does not
reclaim these stages. If an interrupted update leaves one behind, confirm that
no updater is still using it before removing that exact directory. This separation
does not make simultaneous package swaps safe.
Replacing the package directory
The swap publishes the staged package with or without a
package-publication journal.
On macOS and Linux both ways publish with one atomic exchange (renameat2 with
RENAME_EXCHANGE on Linux, renamex_np with RENAME_SWAP on macOS), so the
package path names a complete package at every instant, also when the updater,
its managed helper, or the machine dies. The tools that make the call are the
ones the release-directory conversion below uses. The package-swap step of the
update result reads published by an atomic exchange (<tool>).
A POSIX npm update that prepared a journal records a publish intent, gives the
candidate the name previous inside the journal's recovery directory, and
exchanges that name with the package path. The new package is then installed and
the old one is under previous, which is where every recovery reader expects it
after a publication.
An updater killed between those two steps leaves the old package serving and the
candidate waiting under previous, with the publish intent still in the
journal. The next openclaw update, and openclaw update repair, settle that
leftover before anything else. They claim the installation in the recorded
update lease store, which succeeds only once the killed updater's processes are
gone, return the candidate to its own name, abort the publication, and remove
its recovery directory. The old package and its launchers are not touched. The
update prints what it settled and continues, and its result and run history
carry a package-publication-recovery warning. The journal's printed recovery
command does the same by hand: repair aborts the publication and retire
removes the recovery directory.
A killed update usually also leaves the plugin recovery it reserved, which is a
separate check from the publication. openclaw update repair settles it and
then finishes what the killed update left: it runs Doctor and plugin convergence
for the installed version and restarts a Gateway the update had stopped.
The next openclaw update settles that recovery itself, after the publication,
when nothing needs an operator:
- the installation is a package install, or a source checkout that still holds exactly the build the killed update installed (see below);
- the killed update was a command-line
openclaw update, not one the Gateway started, whose recorded process is no longer running; - the update lease store still holds that process's lease, so claiming the installation shows its child processes are gone too. When a restart emptied that store, the update instead checks the boot each of that update's processes recorded. If every one ran on this same Linux or macOS machine in an earlier boot, none of them can still be running, and the update claims the installation as usual before it settles anything. When the store exists but no longer holds that lease, the update settles the recovery only if that update recorded its candidate verified serving and that same version and build is still installed. An updater releases its lease only after its own processes have ended, and any command that claimed the installation since then proved the same. This is how 2026.11.10 ends an update after it loses its plugin lifecycle lease: the new version is installed and serving, but the run stays recorded as running with its recovery reserved.
It settles the plugin and configuration changes the way repair does. When the
version from before that update is still installed they are rolled back, and
when the Gateway was verified on the version it installed they are kept. The
update prints what it settled, continues, and records an
interrupted-update-recovery warning in its run history.
Older in-place Git updaters can leave recovery records tied to a checkout build. Its version alone does not identify that build. Such an updater records the commit and build it activates before reserving plugin recovery. The next update settles that recovery only when all of these still hold:
- the killed update recorded that activation, for the same build its plugin recovery targets;
- the checkout is still at that commit and has no local changes;
- its build is complete, was made from that commit, and is that same build.
Then the checkout runs the killed update's build, and the update treats it like a package install that has the candidate installed. A checkout that was pulled, edited or rebuilt by hand, or a run recorded by an older updater, keeps the refusal below. Updates through the Git release layout never reserve plugin recovery, so they are unaffected.
Some killed updates also leave work that repair finishes and an update that finds its core already current would skip:
- the killed update replaced the installed version and was not confirmed finished;
- it had begun rolling its plugin changes back on the version it installed;
- it stopped the Gateway and never started it again.
In those cases the update then finishes the installed version the way
openclaw update repair does: it runs Doctor and plugin convergence for that
version, and restarts and verifies a Gateway the killed update had stopped. This
happens before the update checks for a newer version. That work is recorded on a
separate repair run, exactly as repair records it, because the update's own run
does not exist yet at that point. The update adds an
interrupted-update-finalization warning that names that run, prints no
separate result, and then continues. A stopped Gateway is restarted only when
the update would restart it anyway. With --no-restart the update refuses,
because the history cannot show whether the killed update or an operator
stopped it. If Doctor, plugin convergence or the Gateway restart fails, or Doctor
maintenance has to wait, the update stops. It names openclaw update repair and
leaves the installation as repair would leave it.
Otherwise the update stops with Update <id> has unfinished recovery. When
repair can settle the recovery, the message adds the reason and the command:
- The killed update stopped the Gateway and this update was run with
--no-restart. Runopenclaw update repair, which settles the recovery, then restarts and verifies the Gateway. - The Gateway started the update, or a managed helper adopted it. Wait if
the Gateway is still finishing it; otherwise run
openclaw update repair. - An update is still recorded as running and its process is not known to
have exited, or another updater holds the installation. Wait for it; run
openclaw update repairif it has stopped. - The update lease store no longer holds the killed update's lease, and
the store itself is missing or the version and build that update verified
serving is not the one installed. The store was removed or replaced, or
another command already claimed the installation. That includes an earlier
openclaw updatethat claimed it and then refused for one of the reasons above, so a second attempt reports this reason. After a restart the update also refuses this way when the boot record cannot show the killed update's processes gone: the killed update ran an older version that did not record its boot, the machine has no stable identity, it runs on Windows or inside a container, or one of that update's processes recorded no boot. Runopenclaw update repair. - The recovery could not be settled. The message includes the cause. Run
openclaw update repair. - The installation is a source checkout that cannot show the killed update's
build. The message names the reason: no recorded activation, a commit or
build that differs from it, or local changes. Run
openclaw update repair. - The recovery belongs to another installation. Run
openclaw update repairfrom that installation. A pnpm install whose package directory was replaced is the exception below. - A dry run changes nothing. Run
openclaw update.
Recovery that openclaw update repair cannot settle either keeps the plain
refusal without a command.
pnpm gives each OpenClaw version its own package directory, and activation
moves the previous one away. Plugin recovery left by an update that died after
activating therefore names a directory that no longer exists. Both
openclaw update repair and the next openclaw update settle it from the
installation that replaced it when all of these hold:
- the directory that update recorded no longer exists;
- that update ran from this installation's path, which now resolves here;
- every process that update recorded has exited;
- that update recorded its candidate version serving.
The plugin and configuration changes are then settled as for any verified
candidate: usually kept, but a rollback that had already restored something is
finished instead. A commit that update had already begun is finished even when
a later build is installed, but not when the version from before that update
was installed again. That update's run records a
warning:plugin-cohort:replaced-installation entry naming both directories.
The next update still needs the lease proof above. An updater that exited on its
own, rather than being killed, released its lease, so that update stops and
names openclaw update repair; run it once, then update again. When any of the
four facts is missing, both commands refuse and say which one; while that
update's process may still be running they say to wait for it.
The updater does not settle the leftover when another updater still holds the installation, when the lease store is missing or was replaced, when the installed package or a launcher no longer matches the journal, or when a different OpenClaw build wrote the journal. It then refuses with the reason and a next step: wait for the other updater, reinstall, or run the recovery command. See Unfinished publication and rollback.
That state is read only with the recorded intent and the recorded identities of all three directories. A reader that finds the layout without that intent, and the recovery code of earlier releases, refuses it by its identity check instead of taking the candidate for the previous package. An updater killed after the exchange leaves the new package installed, as a killed publication always did from that point. The exchange tool is a separate short-lived process: when the updater is killed while it runs, it can still complete the exchange a moment later, and recovery then reads the publication as published.
Without a journal, the same exchange covers pnpm and Bun, where the directory is
the manager's whole global project, and npm when the journal is not used, for
example with --reapply-local-overrides, for a release replaced in place behind
its package link, or for a target without delegated post-core execution. The
staged
directory first takes the backup name .openclaw.package-backup-<pid>-<time>
beside the directory it replaces. One exchange then puts the new directory in
place and the old one under the backup name.
An updater killed after the staged directory took the backup name and before the exchange leaves the old package serving and the new, unpublished one under that backup name. Nothing needs recovery, and that directory must not be moved into place. A later update that swaps the package in place removes it with the other historical package backups once that update is verified. The exchange tool is a separate short-lived process: when the updater is killed while the tool runs, the tool can still complete the exchange a moment later, which leaves the new package in place and the old one under the backup name.
When the exchange is unavailable (a system without the tool, a filesystem that
refuses the call, or a stage on another filesystem), the update still installs
with two moves, and the step reads published by two moves (atomic exchange unavailable: <reason>). Between the two moves the package path is missing and
openclaw cannot start.
With a journal, the candidate returns to its own name, the old package moves to
previous, and the candidate moves into place. An updater killed before the old
package moves is settled by the next update as above. If it dies between those
moves, the package path is missing and openclaw cannot start from that
installation, so neither openclaw update nor openclaw update repair can run
there. The managed update helper, when it is still alive, or the journal's
printed recovery command, run with the recorded external runtime, finishes the
publication. An update or repair of the same build that still reaches admission
for that installation publishes the recorded candidate into the gap.
Without a journal, the staged directory returns to its stage, the old one moves
to the backup name, and the staged one moves into place. If the updater dies
between those moves, the old directory is intact under the backup name. Check
the version in its
package.json first (for pnpm and Bun, in the openclaw package inside it):
the backup that holds the previous version is the one to restore. Rename it back
to the directory it was taken from, the package path for npm or the global
project directory for pnpm and Bun, then run the update again. No journal
records this swap, and openclaw update repair cannot run while the package is
missing.
Windows, FreeBSD, an npm package link to a checkout, and a staged package that is itself a link to a checkout keep the two moves and do not attempt the exchange. The next update from that checkout restores a package link that a killed update left under the backup name.
After the new package is verified, the updater removes that backup link without
following it. If the filesystem refuses the removal and the link is unchanged,
the update keeps the new package and exits 0. It records a
package-backup-retention warning that names the link and any launcher backups
or database snapshots left beside it, because cleanup stops at the link.
Historical package backups from earlier updates also wait for a later update.
A database snapshot left this way is removed by update cleanup after a later
update is verified successful.
The link still names your checkout, which the updater does not modify. After
checking the installation, remove the link itself and not what it names: use
rm <link> without a trailing slash, or rmdir <link> on Windows, and never a
recursive delete. The other named paths are ordinary directories. A later update
that swaps the package in place also removes the link with the other historical
package backups once that update is verified, unless the filesystem refuses
again. A backup link that was replaced or cannot be read still fails the update,
because the updater can no longer show that the entry is the link it moved
aside.
Rollback after a failed verification still restores with two moves. A restore killed between them leaves the package path missing and the previous package under the backup name; rename it back to the directory it was taken from.
Release directories on OpenClaw-owned prefixes
On macOS and Linux, the prefix that install-cli.sh creates
(<prefix>/tools/node-v<version>) and the durable service copy at
<state dir>/npm keep each release in its own directory. The package path
lib/node_modules/openclaw is a link to
releases/<release>/lib/node_modules/openclaw in the same prefix. The service
definition, bin/openclaw, and the install-cli.sh wrapper keep naming the
package path, so none of them changes during an update.
An update installs the new release into a fresh releases/<release> directory
and verifies it while the old Gateway serves. After the Gateway stops, it
records both releases on the update run and replaces the link with one rename.
The previous release is not modified. Rollback renames a link to the previous
release back into place, after checking that its version, build, and directory
identity still match the record. A release that another updater rewrote in
place is refused as a rollback target.
The first update with this layout support converts a plain package directory:
the existing directory becomes the previous release in releases/ and a link
takes its place, then the update switches the link to the new release. The
conversion is one atomic exchange of the directory and a prepared link
(renameat2 with RENAME_EXCHANGE on Linux, renamex_np with RENAME_SWAP
on macOS), so the package path names a complete package at every instant, also
when the updater is killed. Node has no API for that call. The update makes it
through Node's built-in FFI when the running Node has it (Node 26), and
otherwise through /usr/bin/osascript on macOS or /usr/bin/perl on Linux
x64 and arm64. The package-swap step of the update result says which one ran.
An updater killed before the exchange leaves an unused directory in
releases/ that holds only a link naming nothing. It is not a release:
openclaw update status does not list it, the next update converts the
package directory again, and a successful update removes it once it is a day
old.
When no exchange is available (another platform or architecture without Node
FFI, a system without that perl such as Alpine, or a filesystem that refuses
the call), the update still converts the directory, with two renames: the
directory moves into releases/, then a link takes its place. Between those
two renames the package path is briefly missing. If the updater dies there,
openclaw cannot start, the old package is intact under releases/, and a
leftover lib/node_modules/.openclaw.release-link-* link names it. Rename that
link onto lib/node_modules/openclaw to restore the installation, then run
the update again.
The release layout is an optimisation, and an update never fails because it
cannot be used. When the new release's openclaw launcher is not the link the
prefix already has, when releases/ cannot be created or is on another
filesystem than the package path, or when the installed package cannot be read
as a release, the update finds this before it stops the Gateway and replaces
the package path with the swap described above instead. The update result
carries a warning that names the reason, and the next update tries the release
layout again.
When the Gateway service starts a path inside a release instead of the package
path (an older OpenClaw writes that when it reinstalls the service through the
link), switching releases would leave the service on the old one. The update
replaces the selected release in place instead, so the Gateway starts the new
version, and its restart reinstalls the service from the package path when the
service definition can be rewritten. The update warns with the
openclaw gateway install --force command that binds the service to the package
path if the restart does not. Once the service names the package path, the next
update switches releases. npm global prefixes you
manage yourself, pnpm, Bun, Git checkouts, and Windows keep the swap described
above. A link to a checkout made with npm link is not a release and stays on
the swap. A manual npm install -g into an owned prefix replaces the link with
a plain directory; the next update converts it again.
A successful update removes an unselected release only when no open update run
names it, no running Gateway holds its lease under releases/.leases, and
neither the release nor the link changed in the last 24 hours. openclaw update status lists the active and retained releases.
A matching installed version skips core replacement but still converges plugins. Core updates also
refresh core-command completion; full plugin-command completion rebuilds remain explicit
openclaw completion --write-state runs.
pnpm and Bun on macOS/Linux stage their owning global project and launchers,
preserving the manager's manifests, locks, and sibling packages for rollback.
Concurrent changes to that global project stop activation. Windows Bun updates
are rejected before the service stops because its binary launchers cannot be
relocated by the staged updater; use the owning Bun manager for a
manual update.
Switching a pnpm- or Bun-owned package install to Git with --channel dev is
also rejected before activation. Staged source-checkout exposure currently
requires an npm-owned package symlink; package-to-package updates remain
supported through the owning manager.
The reverse switch is refused the same way when openclaw is a pnpm or Bun
global link to the Git checkout (for example after
pnpm add -g openclaw@link:<checkout>). Replacing that link changes what the
Gateway's installation path means, so the updater refuses before stopping or
changing anything; the CLI and Gateway keep running the checkout. To stay on the
checkout and follow the channel through its release tags, set update.channel
and run openclaw update without --channel. To switch anyway, run
openclaw triage or ask the instance's agent, which can check database, runtime
and Gateway service compatibility before moving the install. This check belongs
to the installed updater; an older updater can still start the switch.
When an npm package link points to a built Git checkout, rollback verifies that same checkout and build before restoring the link and launchers. Local source edits are preserved. Replacing the checkout or rebuilding it during the update prevents automatic rollback; restoring a link alone does not prove runtime safety.
Local packaged overrides
Package updates preserve local dist edits in a recovery bundle before replacing
the old package. Capture happens after service drain, so edits made while the new
version installs are included. A macOS or Linux swap of a package directory
reads the old package at its path immediately before publication. A swap on
another platform, or of a staged link, captures after the old-tree move, and a
release switch reads the previous release in place. The report names the bundle
under the selected state directory's update-recovery/ directory. Keep it until
you have checked the updated installation; removal is manual.
By default, the update installs the new package without replaying local code. To replay edits you trust during that update:
openclaw update --reapply-local-overridesPackages that advertise a content inventory record shipped file hashes and executable status. Replay requires the new package's corresponding baseline and actual bytes to match; upstream changes, unsafe paths, and hardlinked targets prevent replay. A conflict leaves the whole override set in the recovery bundle. Unreferenced content-hashed additions also require manual recovery. Replay runs against the private staged package before it replaces the live package. Publication and restoration refuse to overwrite a destination created concurrently. Replay does not establish that local code remains compatible with the new release.
Older packages without content inventories cannot distinguish local edits from
vendor files. Their regular dist files are preserved for manual inspection,
with no automatic replay, even when the flag is set. Keep enough free space for
that copy; recovery bundles are not automatically pruned. Dependency trees and
inventory metadata are not local override payloads. Symlinks and other unsupported
entries can refuse the update, including entries in otherwise excluded dist
subtrees; repair those entries before retrying. Normal package-manager permission changes,
such as applying the installer's umask, are not treated as local edits.
Preserved overrides are separate from automatic package rollback. A failed update still follows the existing ownership, configuration, schema, and retained-package checks. If late edits invalidate rollback verification, keep both the named package backup and override bundle; the report does not authorize restarting an unverified installation.
This behavior belongs to the updater already running. Back up local edits before the first upgrade from an older updater that does not include it. Git checkouts continue to use the existing clean-worktree and Git update rules.