---
summary: "Optional update implementation background, rationale, and shipped-updater compatibility"
read_when:
  - Investigating update implementation details or shipped-updater compatibility
  - Looking up update migration and rollback rationale
title: "Update implementation background"
doc-schema-version: 1
---

This page preserves implementation details and compatibility notes as optional
background. The required invariants stay in the
[update implementation contract](/install/updating#update-implementation-contract).

## Implementation notes

Candidate Doctor reads both legacy shared-auth rows under maintenance custody.
If both rows are absent, Doctor records the ownership and migration receipts
without reopening the agent database for cleanup. The complete repair plan still
migrates queued outbound deliveries and imports session data. The installed
updater needs no change.

### Release updates

`src/update/` owns updates of Git checkouts and npm, pnpm and Bun global installs.
The Gateway's `update.run` and `openclaw update` both use one path:

1. Preflight refuses before any change and names the reason.
2. The target is prepared in its own release directory while the current Gateway
   keeps serving.
3. The new release checks itself with `update check-release`, from the directory
   it serves from.
4. The release is published, and the Gateway restarts one time.
5. The resident launcher starts the new release as a trial. It commits when the
   Gateway reports ready. After two failed starts, a configuration refusal
   (exit 78), or when the trial budget ends, it restores the previous release
   and recorded raised-floor database preimages.
   Outside a trial, exit 78 restarts the child with the same crash backoff as
   other failures: 1, 2, 5, 10, then 30 seconds.
6. Preparation records refusals, already-current results, and failures before
   activation. It checks for an active trial while holding its preparation lock.
   After activation of a modern launcher trial, only the Gateway that is ready settles the run
   from the launcher trial and preparation lock. A published trial takes precedence
   over an expired lock for the same run. Only a Gateway that runs the target build
   records success. The first core-ready announcement settles the run through the
   same owner as startup completion, before background plugin work, and sends the
   result notice. Restored files alone do not prove that the
   previous Gateway is serving. Startup does not infer a failed update from PID
   reuse or uptime.
7. Every Gateway boot updates installed plugins in the background after core
   readiness, then reloads changed plugins through the existing runtime lifecycle.
   Changes only to resolution, installation, or capability acceptance timestamps
   do not reload a plugin or request an already-current update's Gateway restart.
   A pending trial defers this work. The first plugin result and next command appear
   in matching update details while that plugin step is unsettled; later boots do
   not rewrite the recorded result. Failures otherwise use the Gateway warning log.
   Plugin work does not delay or rewrite the core result, send another notice, or
   trigger rollback. Successful reload warnings stay advisory in plugin details
   without marking activation failed or requesting a retry.

Saved update history does not grant or refuse a new release update. After taking
its preparation lock and checking the installation, the serving release marks
other unfinished runs `failed` with reason `interrupted`, then continues. It
preserves its own run and the run handed over by its serving launcher trial.
Historical plugin-cohort records remain unchanged; the new update does not
adopt or replay their rollback.

Recovery admission still refuses a live in-place update lease and an
`.openclaw-restore-*` directory that may contain the only original state files.
Current preparation locks, active trials, and ordinary preflight checks still
apply. Owned release leftovers are collected by path after the Gateway is ready,
never by matching version strings. Doctor retains its separate cleanup for old
in-place updater runtimes; that process census is not on the update critical path.

Packaged bundled plugins belong to the selected core release, not a second
plugin installation. Channel synchronization retires obsolete compiled-bundle
install records before it plans package updates; switching to a packaged bundle
does not create another path install record. Plugin configuration, explicit local
links, and source-checkout selections stay intact. Registered plugin host links
are reconciled by the existing post-core plugin owner before activation reload.

Once the resident launcher owns an installation, `gateway install` keeps that
state directory's selected launcher as its service entry, including before the
first pending trial replaces an unmodified npm fallback. Checked durable CLI
reuse follows the same selection as a new install. Explicit retained-CLI
recovery still uses the requested recovery entry. Dry runs keep the existing
read-only preview. Immutable activation and switches that need the in-place
installer refuse with a next step; they never replace a launcher-owned
installation through that other path.
Explicit package versions, dist-tags, npm specs, and `--no-restart` keep their
prepared-release behavior.

Before conversion, a node-only package installation with an installed node service, no
Gateway service definition, and no live local Gateway stays with its package installer.
`openclaw update` uses the existing package update flow for that installation;
it does not create a Gateway launcher, forwarding entry, or pending Gateway trial.
Its package result names the updated installation's `node install --force` and
`node restart` commands. Wait for node work to become idle before using them;
the package update does not claim to have replaced or restarted a retained node
runtime.

A previously converted installation keeps its resident release owner even if its
Gateway service was removed; `--no-restart` can still prepare its next release.

Before first conversion, a live foreground Gateway can lose its installation
path from OS process inspection. With operator access, let that Gateway handle
the update through Control UI or `openclaw update`. If it cannot accept the
requested update over RPC, local preparation refuses visibly rather than
claiming an unidentified installation. Stop the Gateway through its existing
owner, then rerun the update. A stopped Gateway remains updatable.

`discoverDatabases` is the state transaction inventory. Boot uses that inventory
to plan pending canonical schema steps and their derived minimum reader floors
before mutating live databases. A schema-version increase alone does not require
a preimage: compatible steps run in place without one. Update preflight requires
1.4 GB free on the installation filesystem, not space for a full copy of state.

Shipped copy-based releases can leave a durable `.upgrade-*/plan.json` after an
interrupted publication. Boot first settles that existing intent under exclusive
physical ownership, before config guards or database inspection. Only this
historical replay can finish planned replacements; new upgrades never write plans
or create copied trees.

Before any floor-raising step, boot publishes the complete recovery manifest at
`<prefix>/releases/<target-release-id>/.restore`, keeping the existing
`{v:1,runId,files:[{live,preimage}]}` format. Paths are absolute; a null preimage
means remove that file on rollback. Only databases whose derived minimum reader
floor rises receive database preimages. SQLite images are independent clones or
byte copies, never hard links to a database that will be mutated in place. Their
`.pre-<build-generation>` names remain discoverable by existing launchers.
A raised-floor database can roll back only through its recorded image.
When legacy config repair changes the config file, its original receives the same
launcher-compatible image and manifest entry before the repair is committed.
On a filesystem without clones, this rare step takes as long as one byte copy of
that database. There is no pre-stop clone probe or copy-time budget. If the required
image cannot be made, boot refuses with exit 78 before the schema step and the
resident launcher restores the previous release.

The resident launcher reads the selected target release's `.restore` record. It
removes the recorded null-preimage files before renaming the recorded images,
then switches back. It does not scan the state tree or read build-global applied
receipts on this path. A malformed manifest fails visibly rather than falling
back to a different recovery plan. Interrupted image renames replay from the
same record.

Targets without `.restore`, including shipped 2026.11.10 releases, retain the
legacy `.pre-<generation>` and receipt interpreter. The new reader restricts
those legacy artifacts to the current trial's existing freshness window. Keep
this compatibility path until the supported rollback floor passes the last
published release without a restore manifest.

A resident launched before the upgrade keeps its existing recovery code until
its service next starts. Admission therefore still retains the old scan's
coverage bounds for floor-raising migrations: external, symlinked or separately
mounted stores, paths more than four directories deep, and stores below
`git-install`, `npm`, `node_modules`, `tmp` or `logs` refuse with a move/retry
instruction. Compatible steps take no image and do not refuse an external
database merely because it is external.

The same canonical in-place migration owners run on ordinary starts and release
trials, under existing custody. New upgrades use no private tree, Doctor subprocess
chain, generic rebuild, or forward file swap or rename. A trial started by an older
preparer repeats admission before migration. A refused trial exits 78 and the
launcher restores the previous release. Ordinary non-trial starts, including
manual package upgrades, keep their existing migration-on-open behavior: a
store's size alone never prevents that Gateway from starting.
Older releases can still keep sessions and other state in legacy files. Boot
runs the existing shared-schema and backed-up credential owners, Doctor's
legacy-file import owner in place, and the remaining schema steps. The ordinary
config writer retires legacy heartbeat state through its existing Doctor owner
before removing that config. These imports are not a copied-state Doctor process.
Direct upgrades from 2026.7.x
retain their session history.

The selected target owns its prepared release directory and `.restore` record,
so a retry from an older preparer cannot reuse another release's receipt.
Images and the initial complete manifest are durable before live mutation.
Retries reuse original images rather than re-imaging changed state. A trial
with no floor-raising step records an empty database restore plan.

Legacy imports initially declare prospective new stores with null preimages.
After successful import and native close, before normal runtime starts, boot
narrows the same v1 record to families it actually created. A later runtime
creation at an unused prospective path, including its WAL, is not a rollback
deletion. Null companions of imaged databases remain recorded even when absent,
so a later WAL cannot be replayed over a restored image. A retry may refresh
still-absent prospective families before mutation, but never replaces an
original image. An interrupted import retains the conservative broad record;
that rare case remains accepted.

The existing `.upgraded-<build-generation>.json` add receipt mirrors the removal
set for installed legacy readers. It contains no copied paths or replacement
operations. Manifest-capable recovery does not consume it.

The `.restore` record stays with its prepared release. Independent
`.pre-<build-generation>` images remain under the existing `pruneGenerations`
retention, owned by the restore module. Committing a trial adds no cleanup hook.

### Uncovered database paths

An uncovered raised-floor path refusal leaves the old Gateway serving. Before
moving a SQLite database, create and verify a full backup, stop the Gateway, then
move its complete database family into the named recovery layout and update its
registration and agent-directory configuration. Do not move an open database or
separate its WAL from its main file. Restart the old Gateway and verify readiness
before retrying the update.

The release switch requires exclusive access to the state stores. The old Gateway
records its shutdown, closes shared-state consumers and identity descriptors, then
releases its ownership lock. Process cleanup and a final canonical state closure
finish before a standalone successor spawns. Its successor observer uses only HTTP
and captured configuration. Update and restart commands release their local readers
before activation and observe the outcome through RPC or the launcher's trial file.

For package adoption, a committed trial completes `gateway restart` even when
this CLI cannot make operator-scoped health requests. A connection without
`operator.read` is reported separately, with the credentials and status command
needed to inspect detailed health. Startup observations have a deadline.

Boot migrations require the existing exclusive database custody. Updaters release
their readers before the successor starts and retire admissions again after
restart settles, including on failure, so later ledger writes reopen canonical
state. Closing SQLite and releasing retained identity descriptors remain part of
that handoff; forward migration does not replace the database file.
On Windows, the task supervisor starts without the Gateway's config or state
bootstrap. Only its child opens the state databases; the waiting supervisor must
not retain a connection or admission descriptor across a release switch.

Outside an update trial, the launcher returns the Gateway's exit status
when the Gateway reports invalid arguments. For example, `openclaw gateway run
--port typo` prints the port error once and exits 1. A missing `--password-file`
is not an argument error: the launcher retries, so the Gateway can start once
the file is available. Unexpected exits still restart.

The Gateway's launcher IPC listener does not keep the child process alive. Once
Gateway cleanup settles, the child exits naturally so the resident launcher can
start the pending release, including after a rollback. Stop and readiness messages
still use the same channel while the Gateway is running. The serving release must
contain this fix; a newer candidate cannot release an older Gateway's IPC reference.

Rules for update changes:

- Change update behavior in `src/update/`. Do no update work while the Gateway is
  stopped: work that needs the new build runs in the new release.
- Validate a release at the path, and with the loader, that it serves from.
- Every update must end with a recorded outcome that names the serving version.
  No run may stay running.
- Shipped updaters (v2026.11.7, v2026.11.10-beta.1 and earlier) still run their
  first update to a new release in place, with their own code, and call contracts
  in the new release. A note below that says the installed updater must contain
  a fix applies only to that first update. The contracts the new release keeps for
  them, the update routes not yet moved to `src/update/`, and the rules for fixing
  legacy update code are in `src/cli/update-cli/AGENTS.md`.

### Proof for update changes

A change to `src/update/`, the `src/daemon` service stage functions,
`release-launcher-forward.mjs`, `openclaw.mjs` or the `Dockerfile` needs real
update runs, recorded with these rules. A missing run is written as "unproven"
and blocks a stable release. The rules come from the 2026-11-23 audit, which
found that earlier receipts did not prove what they claimed.

The `release-update-survivor` CI lane covers the Linux npm/container cell on
PRs that touch update, state, update CLI, or launcher owners. It installs the
PR-head build, builds a distinct successor from the same source with a
disposable schema migration, then runs `openclaw update`. Separate healthy and
crash-after-migration cases check the serving version, trial outcome, schema,
and seeded row counts and contents. The fixture changes scratch source only;
it does not change the shipped schema or replace the other platform cells.

For schema-version or migration changes, CI additionally prepares the tested
merge build through the PR fork-point release's public updater, then boots its
real resident launcher. It kills the candidate before Gateway listen and
records committed schemas and reader floors from inspection copies. The
resident retries and rolls back using its own restore implementation; the
test harness never restores config or databases. T must serve its seeded cron,
sessions, and message history. Raised-floor stores must return to T's schema
and floor; unraised stores must retain T+1's schema and floor. Lazy stores that
did not advance are reported as untouched, not claimed migrated. This gate is
required: reader failures, invalid targets, integrity errors, and incomplete
rollback fail the lane. A fork point whose updater cannot prepare the candidate
must be rebased.

The selected lane also runs the agent SQLite migration chain from the fork-point
schema through the real maintenance owner. Its test-side native observer rejects
bulk-data access: statements that read or write transcript, cold-archive,
embedding, or FTS rows, including `WHERE 0`, and index builds over those rows.
Constant-time metadata DDL is allowed, but touching a bulk table while raising
that store's reader floor fails. Failures name the store and version range.
Real owner integrity checks still run unchanged; only their dynamic test-side
boundary is excluded from migration-access classification; migration-supplied
callbacks remain observed. Unsupported observation APIs fail coverage instead of
silently passing. The sanitized `migration-bulk-access.json` receipt is retained
even when observation fails, with the attempted version range. Failed observations
retain statement identity, method, SQL source, and integrity/coverage facts, not
database objects, catalog snapshots, or queried row values.

- **Platforms:** a Linux systemd user service, a Linux container without a user
  bus, a macOS LaunchAgent and a Windows Scheduled Task. (#203497 merged with
  macOS-only package proof; #203735 and #203769 fixed Linux container failures
  afterwards.)
- **Route:** each run records the update run's `trigger` (`control-ui` or `api`),
  the Gateway log line for `update.run`, and the environment of the Gateway and the
  CLI. A run with `OPENCLAW_UPDATE_PACKAGE_SPEC`, `--tag` or `--no-restart` does
  not prove the Gateway route: those select a local route or a different target
  resolution. A run that ends at a shortened `--timeout` is not a product result.
- **Service:** in the managed-service lanes, the service comes from `openclaw
  gateway install`, and the effective service state is saved after each run
  (`systemctl --user show -p ExecStart,NeedDaemonReload`, `launchctl print`, or
  the task definition and script). A hand-written service definition is not
  proof. The container lane runs with no service on purpose.
- **Next build:** `T+1` has its own build ID and a pending schema step, and the
  crash candidate crashes after migration. Proof distinguishes compatible steps
  with no image from raised-floor steps restored through their recorded `.pre-`
  preimages. A re-stamped copy of `T` proves only the release switch.
- **Freshness:** each receipt names the tested commit and `npm view openclaw
  dist-tags`. It is stale when an update-path file changes or `latest` moves.
- **Installed code:** a change to `src/update/launcher.ts`, `run.ts`,
  `preflight.ts` or `convert-service.ts` after a release needs `T → T+1 → T+2`,
  because the installed release runs that code for its next update.
- **Fault lanes:** a removed update fault lane names the lane that replaces it, or
  the accepted gap.

### Recorded contract notes

The release CLI uses one client deadline for Gateway requests, status polling,
restart requests, and a capability-consent retry through a replacement Gateway.
It retains the latest Gateway-acknowledged `runId` through unavailable status and
CLI errors, and prints the ID at acknowledgement in human output. An ID alone does
not confirm completion. See [status and history](/cli/update/status-and-history) for
JSON output shapes.
Expiry stops client work and joins connection cleanup; it does not cancel an
accepted server update or invalidate a published trial. Run `openclaw update status`
before retrying an unconfirmed request. Preparation and installed-package delegation
retain their own lifecycle budgets. The installed CLI must contain this repair.

The serving Gateway settles its resident activation run from core readiness, not
from a detached maintenance tick. It waits for the resident launcher's committed
trial acknowledgment; if their IPC channel disconnects, it reads the trial once
from disk instead. A slow acknowledgment cannot spend a one-shot settlement before
the launcher commits. Required plugin work stays on the Gateway's existing update
watcher. The candidate must contain this repair; older installed CLIs need no change.

Gateway post-ready maintenance and `openclaw update repair` refresh the known
legacy Git launcher from development build `d44f263`, which incorrectly counted
`gateway status` as a start. The candidate must contain this repair. It applies
only to that launcher's exact bytes in the selected, account-owned installation;
custom launchers, other installations, read-only mode, and resident launchers
are left unchanged. The repair preserves the legacy trial and genuine-start
rollback behavior; it does not settle the trial or rewrite update history. This
is recovery for an observed development install, not a stable-release migration.
The normal next release update replaces the legacy launcher with the resident
launcher.

Git installs that tracked main before the resident launcher can retain a format-1
trial. Before listening, the Gateway captures the matching publication. When the
selected running build reaches core readiness, it rechecks the selection and removes the
trial so a later restart can't roll back that healthy release. Channel health and
update history writes don't gate trial removal.

If the older updater calls the candidate's native install or restart command,
the candidate tries to link that publication to the original run before carrying
out the service action. The Gateway separately recovers the matching run after
the older updater exits, even if that updater removed the trial after its own
healthy response but failed to write history. It retries while it serves if the driver is still
running or the history write fails. A Gateway restart before recovery can leave
the original history entry unchanged with the healthy release still selected.

The Gateway preserves existing repair acknowledgments, unrelated failures, and
recovery records. It needs one matching publication receipt before it can record
success. If the older
updater exits because it can't read the migrated schema, its exit status still
reflects that refusal.

Plugin maintenance runs after every Gateway boot reports ready, including manual
Git pulls, global package replacements, image swaps, and standalone binaries.
Semver-lower candidates retain pre-trial maintenance when neither their declared
state nor agent schema is newer than the running build's; older releases lack the
post-ready job. Missing schema metadata retains that legacy behavior. A lower
version carrying either newer schema waits until its own Gateway is ready, so
candidate maintenance cannot migrate live stores before the trial.
This decision must be present in the installed updater; shipped beta updaters
keep their existing pre-trial behavior. Plugin downloads and installs
do not extend the restart outage. Core success is recorded first; plugin results
arrive later in matching update details. Boot maintenance does not inherit
`--accept-capabilities` consent from an update trial: widened capabilities are
declined with the existing recovery command. Maintenance has a ten-minute command
budget. A Gateway stop can leave no plugin result for that boot; the next boot
tries again. `openclaw plugins update --all` also runs maintenance explicitly.
Core rollback does not wait for plugin maintenance, and a candidate that fails
before readiness does not update plugins. The candidate must contain the post-ready
maintenance call; the installed updater must contain the version-and-schema-aware
pre-restart decision.
The internal maintenance-command result carries exact install-record hashes into
the existing batch reload check. A record changed again before reload is refused.
Removed records do not hot-unload a running plugin; the existing metadata-only
removal policy takes effect at the next Gateway start.

Candidate Doctor's retirement-only pass retains deferred advisory inspection
selectors in its result. Shipped v2026.11.7 and v2026.11.10-beta.1 updaters read
the last Doctor result and run those inspections after Gateway readiness; a
narrow repair pass must not replace them with an empty list. The candidate must
contain this fix.

The serving Gateway records a completed release rollback as a failed update, with
the launcher's reason and the previous version's running facts. Settings → Updates
and `openclaw update status` show that cause, then offer Retry and Report update
failure if it fails again. Saved verification remains labeled as recorded facts;
an unavailable current-health probe adds no separate notice. The failed phase and
its internal check stay in the saved row, not the rollback summary. Startup output
remains in the saved diagnostic details, not a failed update step. Unperformed
verification checks are not reported as warnings. Machine-only Doctor check
receipts stay in saved JSON, not installation steps or report text.
Failed supplemental steps count toward the success headline's warnings without
changing the recorded successful outcome.
The installed updater must contain preparation-step reporting changes; the
restored release must contain rollback reporting changes. No schema or protocol
change is needed.

Candidate Doctor accepts a read-only reader that finishes rebuilding a checkpointed
SQLite WAL index between update capture and source verification. Rebuilding that
index can clear its commit counter and checksum without changing the database.
Migration admission still checks physical identity and committed content, so an
outside write remains refused. The candidate must contain this repair; shipped
first-hop updaters need no change.

At Gateway start, a preparation lock whose owner is dead or has the new Gateway's
PID is released after its run is recorded as failed with reason `interrupted`.
A live preparation owner in another process is left untouched.

Shipped in-place updaters leave their running code in an `openclaw-update-runtime-*`
directory and promise that the next update removes it. On the release path, `openclaw update`
runs Doctor's retained-runtime maintenance in its own process before the update starts, the
same way release preparation removes old releases first. A runtime still in use stays, and
the cleanup never changes the update's outcome. A `--timeout` under 20 minutes skips it,
because the process census cannot be interrupted. The Gateway's
`update.run` and automatic updates do not run it, because the process census would block the
serving Gateway. After the switch to releases, the resident launcher counts as a possible
holder of a runtime without `owner.json`, and later commands no longer recognize its marker.
Only an `openclaw update` run as the first release update removes such a runtime; otherwise
it stays until removed by hand. Shipped updaters need no change.

The resident launcher keeps the 20-minute combined trial ceiling while the new
Gateway prepares state. Once the Gateway reports that boot state preparation has
finished, it has up to 10 more minutes to finish starting, within that same
ceiling. This includes agent database preparation and plugin startup, not just
opening a listener. A measured healthy host took about 496 seconds to reach
post-ready maintenance; the 600-second window leaves about 104 seconds of margin.
Hangs before or during boot state preparation still use the full 20-minute limit.
After rollback, the serving Gateway records why the update failed and names its
running version. Another Update click starts a normal attempt; a failed version
is not blocked. The resident launcher and candidate boot code must both contain
this change; a candidate without the stage report keeps the original deadline.

Candidate Doctor removes empty snapshot directories left by cancellation between
private directory creation and native-token acquisition, after its inspection
workers have settled. Unconfirmed worker cleanup and unowned snapshot payloads
remain retained. The candidate must contain this repair; installed updaters need
no schema or protocol change.

Git release conversion leaves the serving link unchanged until candidate checks
and service ownership revalidation finish. At activation, the legacy
`git-install/lib/node_modules/openclaw` link follows `git-install/openclaw`, so
existing CLI paths keep working without retaining a separate release selection.
This also applies with `--no-restart`; the launcher selects the pending candidate
on its next start. The installed updater must contain this repair.

Git preparation carries forward an existing host OpenClaw ID binding when its
native crate still matches the target. If the binding needs rebuilding, that
build must succeed in the prepared release before it can replace the serving
Gateway. Checkouts without a host binding still skip the opt-in build. The
installed updater must contain this change.

Local npm frontends can offer their installed package to a managed package
release. The resident release runs the update, with an explicit local package
source, and publishes forwarding with the validated pending trial. Managed
start/restart then uses its existing native activation once, preserving restart
options such as `--force` and `--wait`. An already pending trial goes straight
to activation, even when the npm entry could not be attached to the launcher.
The installed resident updater must contain forwarding publication support.
Git installation identity checks and Gateway RPC admission remain unchanged.

Service reconciliation recognizes a deleted pnpm store generation only when it
belongs to the same global root as a verified active pnpm install. This repairs
older service definitions without adopting another global installation. The
candidate also retains the post-activation predicate imported by supported
2026.9 extended-stable updaters.

The candidate CLI and Matrix plugin keep explicit `matrix doctor inspect` and
`matrix doctor recover --account <id> --accept-snapshot-rollback` available through
the separate Doctor contract when an unfinished migration withholds normal Matrix
commands. Recovery retains snapshot validation and exclusive crypto custody. It
never runs automatically or settles the deferred migration: after explicit
recovery, rerun `openclaw update repair` or `openclaw doctor --fix`, then restart
the Gateway. Older installed CLIs do not gain this route from a newer plugin alone.

When a package baseline's final rescan detects stat drift that only moved the
change time or link count (attribute, ACL or extended-attribute changes, a
same-mode `chmod`, or a hard link added or removed by a backup, sync, indexing
or security tool), the scan re-reads only those entries: a file's bytes, a
symbolic link's target or a directory's entry names. When they match what the
scan recorded, the update continues and reports a warning naming the first
entries and their changed fields. Any other drift, or drifted entries whose
contents changed, still refuses package replacement. A change after the scan
is caught when a rollback verifies the retained package before restoring it.
Local failure output and `openclaw update status --json`
diagnostics identify the first entry relative to the package root (`.` for the
root), changed stat fields, and their before/after values. Public failure reports
retain only the changed field names. An unavailable original inode still refuses
inspection, identifying the entry and zero inode locally and only the closed
unavailable-inode classification publicly. These observations do not identify the writer
or establish why a Windows update failed. The installed updater must contain this
diagnostic change; a newer candidate cannot change an older updater's scan.

Candidate Doctor compares pending plugin migration obligations independently of
plugin order and repair guidance. A changed owner, protected path, or migration
requirement still refuses input publication; diagnostics name added or removed
owners even when the displayed ID summary is truncated. The candidate must contain
this repair; the installed updater needs no schema or protocol change.

Update Doctor still defers agent database path repair so the captured rollback
inventory stays unchanged. It reads the registrations and warns only when one
needs that repair, with the count; a registry with nothing to repair adds no
warning to the update result. The candidate must contain this change; the
installed updater needs no schema or protocol change.

Gateway update handoff preparation and its parent-side lease reads, identity checks,
and cleanup run in the existing handoff worker. Slow coordinator filesystem work
does not block the serving Gateway. Parking and terminal commit still await exact
lease ownership; signal admission uses the already-owned local lifecycle. The
installed Gateway must contain this repair. Detached helpers keep their existing
lease format, synchronous store owner, and recovery behavior.

A newer Doctor recognizes retained update captures whose state directory used
an older Windows short-path spelling. Scope comparison resolves the recorded
state directory and configuration parent without changing sealed capture bytes
or following the final configuration entry. A different selected state directory
or configuration entry remains rejected.

On Gateway startup, older supported database schemas advance through their
canonical migration owners on the live databases under exclusive custody. Boot
does not copy configuration into a private tree, run a Doctor chain, or publish
replacement database files. Existing configuration reading and normalization
stay with their canonical owners.

If an earlier upgrade already broke a scheduled job, run `openclaw doctor --fix`.
While the applied upgrade receipt remains, Doctor can verify the saved account at
its old path and restore it without changing the schedule, enabling the job, or
replaying a missed run. If the saved account no longer matches and no usable
receipt remains, Doctor names the affected job and shows how to choose its
account. It leaves the job unchanged. To explicitly choose an account, use
`openclaw automations edit <id> --model <provider/model>@<profileId>`.

Floor-raising SQLite migrations retain independent preimages as
`<file>.pre-<build-generation>`, named after the target build generation, so two
builds of one version can retain separate recovery images. Builds without a
build ID, and earlier releases, used `<file>.pre-<version>`. The per-target
`releases/<target>/.restore` manifest keeps the existing v1 format and records
the images before live mutation. Compatible steps create no database image.
Existing release and recovery-image retention owns their eventual retirement;
there is no new post-commit cleanup hook. Retired startup-migration backups,
SQLite `.bak` files, and media-persistence recovery images remain subject to
their existing operator or Doctor retention decisions.

Offline Doctor prepares no extra inspection image when its existing maintenance
owner proves custody and the database has no WAL frames or rollback journal.
These drained SQLite families use immutable reads. Retained WAL, journals, and
unowned sources keep private snapshots so inspections preserve recovery receipts.
Stopped-update backup inventory verification reads registrations from
the completed backup image while retaining filesystem inventory and source-change
checks. The candidate must contain these changes; backup publication, integrity
checks, migrations, and rollback rules are unchanged.

Candidate Doctor checks an existing OpenClaw ID role catalog against local
membership, offers missing preset definitions only with repair consent, and
preserves existing definitions, the named default, and assignments. Its cron
owner review enables named-role enforcement only when `gateway.roles.default`
is set. These checks and repairs must be present in the candidate Doctor; the
installed updater needs no protocol or schema change.

Lazy SQLite schema catalogs load through the retained updater's module loader.
An updater that first needs a catalog after Git activation therefore reads its
own generation, not the candidate's replacement JSON. This fix must be present
in the running updater; a newer candidate cannot repair an older updater's
filesystem-based loader. If an older Git updater fails with a catalog `tables`
TypeError after activation, preserve its recovery artifacts and use the
[manual source update procedure](/install/updating/update-methods#source-checkout-servers-reference-script)
to install a corrected updater before retrying.

After candidate Doctor migrates runtime-pin metadata, activation reads that
completed intent before rebinding the managed Gateway. Missing metadata at the
start of an update no longer forces a restart of the old installation against
newly migrated state. Existing native definition and runtime-intent checks still
protect operator changes. This requires the installed updater to contain the fix.

Private plugin projection materializes eligible external data-suffixed file links
at their logical in-package filenames before recording the final code-link
inventory. Both the alias and its inventoried canonical target must have one of
the case-sensitive extensions `.txt`, `.json`, `.yaml`, `.yml`, `.toml`, `.ini`,
`.cfg`, `.csv`, or `.xml`; the target must be a non-executable regular file
outside the alias's nearest package root with a regular inventoried `package.json`
(symlink manifests do not establish this boundary). The existing guarded copy
checks source identity, bounds bytes, refuses occupied destinations, and creates
an independent private file. Each alias is included in snapshot space accounting.

This is not general symlink flattening or file-content classification. Package
scope metadata (`package.json`), relocation-owned files (`.modules.yaml` and
`.bin` launchers), executable targets, code/native/unknown extensions, internal
links, directory/dependency/host links, and dangling links keep their existing
handling. A data-looking alias to a target with a code/native/unknown suffix is
not eligible. Non-executable binary bytes (including ELF) with allowed data
suffixes are eligible: this is a path/mode contract, not native-content detection.
Data that requires symlink identity, shared writes, canonical-parent sibling lookup,
or a suffix outside this list is not supported by this normalization. Files
mislabeled as ordinary data are not identified by inspecting their contents.

Projection uses only already inventoried entries and edges; it does not discover
new paths or grant Doctor additional filesystem authority. Ordinary generation
capture already detaches file aliases, so resource bytes and logical filenames,
not original `lstat`, `readlink`, inode, or shared-write identity, are the supported
data contract. Fix representation at this producer boundary instead of carrying
exceptions through Doctor and each runtime consumer. Recognized native files
retain separate identity and admission rules. After binding validation, a late
alias retarget cannot redirect the copy: it uses the inventoried canonical target
path, with source identity rechecked by the guarded copier. The runtime performing
plugin projection must contain this fix; an older projector does not gain it from a receipt or new
environment variable. Existing update/Doctor admission and rollback checks are
unchanged.

Candidate Doctor recovers interrupted legacy heartbeat runs through cron's startup
recovery owner before converting them to automations, while holding offline
maintenance custody. Live or unproved runtime ownership leaves the conversion and
configuration pending with an update warning. Runs needing startup notifications
are converted with their original run marker, history, and receipt intact so the
Gateway can recover them and deliver their notifications without quarantining the
retired payload. Conversion preserves pending execution facts even when it disables
the monitor; startup still restores the recorded result without re-enabling it.
The candidate must contain this fix; published updaters need no
new marker or schema change.

Candidate Doctor repairs retained ISO-8601 session `endedAt` strings before
canonical session admission, preserving the original database backup and updating
indexed timing together. This repair must be present in the candidate Doctor;
the installed updater needs no protocol or schema change.

Engine identification reads the committed SQLite engine anchor in an isolated
read-only transaction without copying a healthy live database. Hot rollback
journals and incomplete WAL families retain private recovery, and unreadable or
invalid anchors still refuse admission. Artifact-preserving inspection scopes and
offline maintenance or exclusive source locks also retain private reads so engine identification cannot
change retained SHM bytes or borrow another process's native custody.
This applies to conditional update
capture, engine admission, and version-zero candidate validation probes. The
binary performing the probe must contain this fix; a candidate cannot repair an
older installed updater's preflight. Strict recovery captures keep their separate
artifact-preservation requirements. No schema or worker-version bump is required.

Git-source and immutable updates probe support before passing `--no-lazy-fetch`.
Older Git runs the same inspection commands without that option; partial clones
may fetch promised objects. This fix must be present in the installed updater;
a downloaded candidate cannot repair an older updater's preflight.

Interactive failed-update triage preserves the invoking operator's `PATH`, home,
and authentication environment before candidate admission enters the managed
Gateway environment. Repair agents still receive the latest target installation's
state, config, and workspace selectors and require launch confirmation. The
installed updater must contain this fix; a downloaded candidate cannot repair
the older updater's already-captured environment. No schema or config migration
is required.

SQLite header-probe timeouts report the discovery path count and link to the
manual package-manager hop. A probe batch that misses its 10-second deadline now
splits and retries, so slow or cold storage gets an answer; a path that cannot
answer alone still refuses the backup. Backup refusal and rollback safety are
unchanged. These changes require the updater performing discovery to contain the
fix; a candidate cannot change an older installed updater's probe.

Candidate Doctor prepares plugin setup sources asynchronously before resolving
legacy session migrations. Configured external channels can then finish
post-plugin Doctor without an unprepared-source refusal blocking later state
repairs. Existing plugin selection, activation, and source checks still apply.
The candidate must contain this fix; published updaters need no new marker or
schema change.

Plugin updates preserve authored environment references when a replacement
plugin moves their settings, including single-file includes. The candidate
plugin-update command must contain this repair; the installed updater needs no
new marker or schema migration. Existing config and plugin-index records remain
readable. Previously flattened literals are preserved, not guessed back into
references. Config publication, backup, rollback, and deferred data-migration
guidance keep their existing owners.

Candidate Gateway rehearsal can prepare strictly valid config in its complete
private update namespace even when a newer release wrote the config. It preserves
the source writer stamp for installed-updater capture checks; the target's normal
validated-downgrade writer records its version before live restart. Ordinary
service startup, force/reset actions, invalid config, and paths outside that
private namespace retain their future-config refusal. The candidate Gateway must
contain this repair; the installed updater needs no change.

Candidate state inventory includes normally discovered global plugins even when
there is no install record or explicit load path. Their private copies retain
`extensions/<name>` discovery, including linked plugin directories, so candidate
Doctor validates configured slots against the same installed plugins. The
candidate snapshot worker must contain this fix; validation remains strict and
live plugin configuration is unchanged.

During captured SQLite migrations, candidate Doctor reads current update authority
through private snapshots. It does not retain an independent WAL reader that can
block its own next migration's exclusive lock. Exec approvals policy, local socket
credentials, and verified rollback attribution retain their existing checks. This
repair requires the candidate Doctor; the installed updater needs no change.

When retrying an update from a restored 2026.9.37 profile, Doctor configures
shared-state journaling before taking the exclusive schema migration lock. This
lets the agent maintenance worker acquire its lease after shared-state migration.

Gateway cleanup preserves retired managed npm plugin generations referenced by
absolute or home-relative paths in startup or current configuration. This keeps
explicit executable pins working after an update without rewriting their settings.
Removing a startup reference allows reclamation after a Gateway restart; current
references protect their files on each cleanup pass. The candidate Gateway must
contain this fix. It does not restore generations already deleted or discover
references supplied only through environment variables, relative paths, or external
symlinks. An incidental path-valued setting can conservatively retain extra files.

If a retained npm marker cannot be read or parsed, cleanup reports that candidate
and leaves its files intact. Other eligible retired npm installs are still cleaned
during the same pass, including legacy shared-root installs.

The candidate macOS app's narrow credential Doctor also completes pending local
service-runtime intent migration before native startup selects a Gateway. This
prevents an absent migration receipt from preserving the old seed after credential
cutover advances shared state. The daemon migration owner keeps explicit pins and
conflict refusals; preparation does not seed a runtime or start a service. Retry
also reconciles intent when credential cutover already completed. The candidate
must contain this fix; older installed updaters are unchanged.

After draining database readers and writers, candidate Doctor inspects SQLite
reclamation mode without copying databases whose WAL is empty or absent and whose
rollback journal is absent. Immutable reads preserve source artifacts; databases
with recovery content retain the private snapshot path. Conversion still uses the
existing maintenance, space, and integrity checks. This requires the candidate
Doctor; the installed updater needs no new protocol.

Synchronous integrity workers preserve the migration owner's selected schema-only
check, matching the asynchronous worker path. Explicit full verification keeps
its full coverage; the candidate must contain this transport fix.

Candidate Doctor prepares its read-only SQLite inspection snapshots asynchronously,
including lease and auth inspection and captured session repair planning. Cancellation
joins the snapshot child and its cleanup. Snapshot allocation checks the destination's
free space against the database, WAL, and rollback journal before copying; unknown
capacity retains best-effort behavior. These fixes must be present in the candidate
Doctor and snapshot worker; they do not change an older installed updater's inspection.
New macOS and Windows agent leases record platform boot identity so a dead owner from
the same boot can use existing quick recovery admission. Legacy or unknown provenance
still requires the full integrity gate; existing leases are not backfilled.

Pre-update config copies publish through a temporary file and same-directory
rename. An interrupted write preserves the previous `.pre-update` copy, and a
later snapshot attempt can retry. Post-update recovery refuses malformed copies
and leaves the current config intact. This repair must be present in the updater
taking the snapshot; it does not establish power-loss durability.

On macOS, Doctor reports generated service environment values surrounded by
literal double quotes. Interactive `openclaw doctor` can back up the private env
file and remove one outer quote pair after confirmation; unrelated bytes stay
unchanged. Quotes can be intentional, so unattended Doctor and `doctor --fix --yes`
only report this finding. Restart the affected gateway or node service after
repair, and correct inherited shell values before reinstalling. This recovery
requires the candidate Doctor; the service writer continues to preserve input values.

Managed systemd Gateway activation also covers packages replaced outside
`openclaw update`. Before ordinary startup admission, the native service reader
must identify this process as the running unit's MainPID. Only older database
schemas trigger Doctor's exclusive maintenance, verified pre-migration backups,
and forward migration owners. The activation adapter does not control services
or run the full Doctor health-repair flow on normal restarts. Unverifiable,
foreign-owned, and newer state retains its refusal and recovery guidance.

Durable background exec adds an optional, first-use `durable_background_processes`
table through the existing shared-state worker and schema owner. The candidate
contains this addition; the installed updater needs no new protocol. Existing
databases keep their schema version and records, and startup reads do not create
the table. Candidate startup re-adopts retained user units without restarting
their commands. Rollback binaries leave the additive table and systemd units
alone; inspect and stop those units with the systemd user manager before returning
to a binary without durable-process support.

Linux managed updates run in a separate user service and slice, so an agent exec's
descendant cleanup, Gateway restarts, and the Gateway unit's memory limit do not
own the handoff. If its recorded helper and updater die, update status or startup
reconciliation records `handoff-terminated` with the last phase. An owned npm stage
that never reached activation is removed after checking for surviving work;
uncertain cleanup leaves a warning and retains the stage. Activation recovery
and backups remain with their existing recovery owners. These changes must be
present in the installed updater; a newer candidate cannot repair an old launcher.

Candidate Doctor inspects the managed service even after the previous Gateway
releases its state lease. On macOS, it unloads a loaded, enabled LaunchAgent
between KeepAlive respawns before entering maintenance and records that stop for
finalization to restore. Unloaded or disabled services remain stopped. This fix
must be present in the candidate; the installed updater does not need it.

If an update driver disappears after the candidate was recorded as installed and
serving, reconciliation records success with a driver-loss warning. It preserves
plugin warnings and does not invent command exit codes or a current health check.
Unverified candidates and recorded failures or recovery keep their failure path.
The reconciling candidate must contain this change; it uses observations older
updaters already record. A first update from an older release still uses that
release's handoff launcher, and previously terminal history is not rewritten.

Managed systemd stops bound the native command by the selected unit's effective
stop timeout plus five seconds. Unavailable or infinite policy uses the finite
Gateway stop budget with a warning; a command timeout retains its reason code
through the existing recovery path. This requires the installed updater to
contain the fix. A candidate cannot change an older updater's stop command.
Requester notices distinguish restart preparation from update completion. Failed
runs describe the failed phase in plain language, retain its reason code, and
include the next action. Before activation, a recorded serving observation names
the current version still running; after activation, the previous serving version
is named only after recorded recovery verifies it. Maintenance refusals
remove the known database path before public diagnostic projection so recorded
holder details survive redaction and truncation. Claim formats are unchanged.

If an agent database's state lock was removed or replaced, shutdown still releases
its native worker and records the lost lock and current holder in a warning.
It leaves the replacement lock and unowned lease records alone for recovery;
shutdown never treats lost ownership as a clean checkpoint. Failed plugin cleanup
keeps the Gateway's process-exit deadline active so a managed update can reach its
existing stop-failure recovery instead of waiting indefinitely. These repairs must
be present in the old Gateway being stopped, not only in the update candidate.

On Linux, update workers verify their driver's ancestry through kernel procfs
identities when the native process helper cannot load, including older-glibc
hosts. The candidate worker must contain this fix. The inherited run ID alone
never grants continuation: driver liveness, birth identity, and parent birth
ordering remain required. If both native inspection and procfs are unavailable,
Doctor records `ancestry-unverified`; restore readable `/proc/<pid>/stat` or a
compatible process helper, wait for the recorded driver to exit, then run
`openclaw update repair`. Doctor reports the native load failure and runtime
glibc version when available.

SQLite update backup admission measures database and journal families, reserves the
retained backup and writable rollback images, and sizes history scratch from shared
state rather than a large agent database. Actual rollback output space is checked
again before current databases move. A disk-space refusal retains the required and
available capacity and the backup or rollback volume role in the package-swap failure
fact without exposing private paths. The candidate worker and installed updater
must contain the diagnostic repair; an older updater cannot gain it from a newer
candidate alone. If capture refuses before the package changes, final recovery
restarts and verifies the previous owned Gateway unless recorded data is at risk.

Legacy PostgreSQL `update restore` uses a fresh prepared anchor on each attempt.
After a prepublication refusal, correcting the reported obstruction allows the
same native request to retry without overwriting an earlier recovery preparation.
The candidate restore implementation must contain this fix; the supervisor needs no change.

When artifact-preserving SQLite inspection exhausts its stabilization attempts,
update failures retain the final consistency reason code and attempt count in
`openclaw update status` and the prepared failure report. The candidate worker
must contain this diagnostic change. Snapshot checks and retry limits are unchanged;
the reason identifies the failed check, not the writer or underlying cause.

Candidate Doctor preserves same-conversation automation continuations when adopting
a stored inference account. It carries forward the original authenticated source
only when its old executable revision still matches, then binds that source and
existing standing-grant references to the restricted definition. It also records
a determinable host-managed account and its explicitly selected Codex runtime;
native-owned and model-locked sessions remain unchanged. Stale captures
stay stale; runtime authorization, conversation identity and revocation checks
remain required. The candidate must contain this repair.

An external supervisor's accepted native update (`update migrate`, then
`update finish`) is recorded in update history as a succeeded run that started
at migration. A later recorded update therefore lets `openclaw update cleanup`
retire rollback originals that earlier migrations left, while the latest
update's own originals stay protected. The candidate must contain this change;
the supervisor needs none. A failed history write leaves a retry warning in the
`update finish` result. Releases swapped without the native protocol are not
recorded.

Background discovery failures are logged and retried at the next scheduled check.
Gateway shutdown cancellation stays quiet; unexpected scheduled task failures
are reported by the scheduler without restarting the Gateway.

**Updates always work** (`openclaw update` finishes best effort everywhere). Changes to update, Doctor, service lifecycle, migrations, plugin loading: state their update behavior. Installed updater runs first, can't be patched; candidate fixes key on markers shipped drivers set; existing operator state = input. Recoverable hiccups → recorded warnings; back up before mutating, let rollback restore it; refuse only for named data risk with previous Gateway kept running. Timeouts and budgets: generous, derived from measured state, sized for slow hardware. Proof: published-driver × candidate cell.

Candidate Doctor imports historical image-project snapshots as non-repository
runtime preparation while retaining the original serialized snapshot as evidence.
Historical shared-schema-21 placements retain their existing preparation evidence
and cleanup custody under current constraints; unsettled worker claims refuse
the atomic cutover without advancing either marker. Missing predicate columns
are derived from their original JSON before publication.
Historical agent-schema-24 recovery envelopes remain archival columns; queued
inputs become interrupted before the schema markers advance, never restart replay
authority. Both repairs use the existing maintenance transaction and verified
backup. Malformed or conflicting image preparation refuses the cutover without
discarding its record. The candidate must contain these repairs; the installed
updater needs no new protocol. Restore the verified pre-migration database with
its matching binary for rollback rather than lowering version markers.

Legacy in-place PostgreSQL original-state captures acquire offline custody before
using the exact database backup provider. The installed updater must contain this repair.

On that legacy path, the pre-migration database backup for PostgreSQL families
needs exclusive state ownership, and it runs after activation replaces the install. When ownership is
unavailable after the service stop, for example because a Gateway the updater does
not manage is still serving, the update now refuses before activation, leaving
the install unchanged and the Gateway running. Stop the Gateway through its service
owner, then rerun the update. The installed updater must contain this repair.
Update-history writes participate in PostgreSQL's generation handoff to Doctor;
all other generation checks remain in force. Update status reads history and
recovery outcomes through the configured database engine.

The managed update helper owns recovery when its updater exits by signal or
without a readable result after either the helper or the updater stopped the
Gateway. Both recovery paths use the same update-history evidence of an
unfinished stop: the helper's stop step, or a managed handoff followed by the
updater's activation phase while the Gateway is currently stopped. The handoff
record remains usable after target selection records a package-manager method.
Its staged runtime keeps
bookkeeping available while the installed package is missing. An untouched
publication preparation is retired and the verified original Gateway restored;
an interrupted publication completes the recorded candidate, runs post-core
repair as the same update's continuation, then restarts and verifies the managed
Gateway. A plugin cohort that the killed updater reserved for this update is
settled by that continuation before Doctor runs; after a restored original,
the original runtime settles it before the Gateway restarts. If that settlement
fails, the original Gateway still restarts and update history names
`openclaw update repair` before the next update. The helper never settles a cohort
that belongs to another update. Update history records rollback, success with
recovery, or an actionable failure. Lost ownership, named data risk, and
unverifiable runtime identity still keep the Gateway stopped. The helper that starts the update must contain this
change; staging a newer candidate cannot repair an older helper.

During overlapping Gateway restarts, config recovery reads health facts through
the same isolated read-only transaction used for startup plugin metadata while
the previous database owner is verified alive. It avoids copying unrelated
shared state. Offline recovery, retained snapshots, and schema maintenance keep
their private snapshot path; config repair still completes before admission.

Update inspection and snapshot workers bind plugin metadata discovery to the
selected installation's state directory, including requests from older installed
updaters. A different profile's database version must not block that inspection.
The candidate worker must contain this repair; an older updater inspecting with
its own worker still needs an updated runtime.

For released updaters that still rehearse Doctor on private state, the candidate
snapshot worker preserves file-backed cold transcript rows and projects their
payloads into the private `sessions/cold/` directories. Immutable regular files
use hard links, with a reflink or byte copy when linking is unavailable. Existing
files are never rewritten or chmodded through those links. Windows always copies,
because removing a hard link on a filesystem without POSIX delete semantics, such
as an SMB share, clears the read-only attribute of the shared live file.
Rehearsal reads keep the normal archive integrity checks; a corrupt payload
remains corrupt in the copy, and a referenced file already missing from live
state stays missing. Capture continues with a snapshot warning, so only a Doctor
repair that reads that archive fails, as it would on live state. The candidate inventory
adds cold-file bytes to the historical `pluginBytes` allowance so released
parents budget the full copy fallback and its I/O time. Inventory reads archive
names from a read-only database snapshot and measures the referenced files;
unreferenced cold files are excluded, and payload bodies are not read for sizing.
The candidate worker must contain this fix; no schema or updater protocol change
is needed. Files created after inventory retain the existing live-growth limit
of the rehearsal estimate.

Private Doctor and post-core workers validate command fields before entering maintenance.
The delegated executor admits its grant data separately and still checks live process and
installation ownership before effects. Callbacks and live deadline objects stay in the
initiating process; only serializable options cross the migrated-update handoff.

Native `openclaw update migrate` reports progress while inspecting configuration
and schemas, capturing its database backup, and verifying the migrated schemas.
Recovery copies use short filenames even when the state directory is deeply
nested. The backup directory's `sources.json` maps each relative filename to its
original absolute database path, independently of the recovery receipt or run history.
Before reporting migration complete, the candidate checks configured and discovered
nonheld agent databases against its schema and ownership requirements using the
post-Doctor configuration. This includes stores startup can reopen after their
registry entries were lost. A refusal retains the recovery backup and prevents
the supervisor from switching to the candidate. Held deleted-agent databases stay
outside this check and remain untouched until explicit restoration.
Update Doctor omits the standalone pre-shutdown transcript archive warmup because
the updater already owns the stopped-Gateway window. Required archive migrations
and their integrity and recovery checks still run under maintenance custody.
The candidate must contain this change; older installed updater work is unchanged.

Native migration records the advisory checks selected by candidate Doctor in its
existing recovery receipt. After the supervisor accepts the serving Gateway,
`openclaw update finish` runs those selected `doctor --lint` checks and records
findings in update history. If readiness, inspection, or history recording fails,
the update stays accepted and the pending checks remain retryable with
`openclaw update finish`; the result reports the next action. Migration admission,
repairs, backup verification, and recovery fences still complete before startup.

Cold transcript navigation backfill uses about ten minutes of archive work per
Doctor invocation, finishing the current archive transaction before stopping.
Doctor and the native update receipt report migrated and pending archive counts;
pending navigation is a recoverable warning, so it does not fail or roll back the
update. `openclaw update finish` retains the warning in update history. Every
later native update runs candidate Doctor again even when database schemas are
already current, and resumes the remaining archives. Operators can also run
`openclaw doctor --fix`; pending archives retain their existing cold-restore path.

During a native update, when plugins are unchanged and only deferred model retirement
remains, a supporting candidate completes the second Doctor pass with the required
config, auth, session, and cron repairs and final validation. Startup, database admission, and config
preparation still run in full. Other pending work or incomplete discovery selects
the full Doctor flow; older candidates and standalone `openclaw update repair`
continue using the full pass.

When that second pass widens, its diagnostics name the first config eligibility
check or retained contribution that required the full flow. These names contain
no config values. Gateway verification timing ends at readiness; separate timing
steps cover post-ready maintenance, plugin commit, and recovery-artifact cleanup.
The candidate supplies Doctor diagnostics, while the installed updater must
contain the timing changes.

Stopped update and Doctor database snapshots tolerate concurrent read-only SQLite
probes. The transient `-shm` WAL index is rebuilt privately, never copied or used
to detect durable changes. Empty WAL files created by readers count as absent.
Changes to the main database, WAL data, or rollback journal still refuse the
stopped backup and identify the changed file. This repair must
be present in the runtime performing the snapshot, including the candidate worker
when the installed updater delegates capture to it.

Under the native updater's stopped-writer handoff, backup checkpoints committed WAL
frames once before recording source identities and taking the recovery image. The
same integrity and foreign-key checks run on that image without another copy.
For checkpointed databases under stopped-update custody, backup identifies the
database engine from the retained backup image instead of acquiring a second
whole-store image for classification. A reader-pinned WAL or rollback journal retains
private recovery and pre-capture engine inspection. Backup digests, PostgreSQL exports, and
source-change refusal still apply. The candidate backup worker must contain this change.

Candidate Doctor separates its initial database admission from the updater's
rollback baseline. If databases changed after the updater captured them, Doctor
warns and continues from the current observed state rather than aborting an
otherwise valid migration. The receipt permanently disables automatic database
restoration for that update, so a later failure cannot overwrite newer data with
the stale backup. Existing integrity, schema, and maintenance-ownership checks
still apply, as do checks for writes after maintenance admission. The candidate must contain
this repair; the installed updater's capture and backup checks are unchanged.
Empty WAL-index transitions without write evidence remain rollback-eligible.
An outside read-only SQLite open, such as a monitoring script using `mode=ro`, can
rebuild the WAL index over retained frames after Doctor admits a database. The
rebuild resets only the index change counter, so Doctor still accepts that
database at migration publication when its file identity, committed content and
last commit checksum are unchanged, and automatic restoration stays available.
Any commit after admission, including one that restores identical content, still
refuses. The Doctor of the version being installed owns this check, so updates
from older releases benefit once the target contains it.
Each migration also needs every other connection to its database closed. Doctor
waits up to 5 seconds for an outside reader or probe to close before it gives
up; a tool that keeps the database open for the whole update still stops the
migration, and the error names the database it could not take over. Close that
tool, then run `openclaw update repair`.

The post-plugin Doctor runs for plugin changes, deferred model retirement, and
pending deferred plugin migrations. Before each Doctor, the updater observes its
own state database after ledger writes; Doctor then publishes the settled
postimage of captured SQLite databases it opened. These receipts keep automatic
rollback bound to the update's database generations. As with native Doctor close
receipts, raw non-OpenClaw writes during the update window can be absorbed for
those databases. Changes to untouched captured databases still block automatic
restoration. Both the installed updater and candidate Doctor must contain this
repair; a fixed candidate cannot repair an older updater's missing attribution.

When only model retirement remains after plugin convergence, Doctor can use its
existing narrow contribution pass. Settling a plugin migration, including a
successful state migration, permits that pass when config inputs and the
validated config are unchanged. Actual config or validated-setting changes,
plugin changes, unresolved migrations, and new findings still require the full
pass. An explicit `openclaw doctor` continues to run the full pass. This correction
must be in the candidate Doctor; the installed updater must already support
retirement-only requests. Older updaters keep their existing full-pass selection.

Standing advice about a custom Codex executable, enabled Computer Use, or authored
native Codex request parameters that Doctor cannot migrate remains
visible in Doctor output and update warnings without preventing that narrow pass.
Invalid inline command arguments, unfinished repairs, and access-policy warnings
still require the full pass, as do redundant service-tier parameters that Doctor
can remove. This distinction must be in the candidate Doctor;
it does not require another updater change.

When a retirement-only request needs the full pass, the candidate Doctor writes a
fixed `Retirement-only Doctor widened:` reason to stderr for every config blocker,
including the specific model-retirement condition and Codex warning source.
Updated updaters retain these reasons in step diagnostics and compacted update
history. The candidate and installed updater must both contain this diagnostic
fix to retain every reason there;
older updaters still run the same repairs.

Direct updates from extended-stable 2026.9.33 and 2026.9.34 are supported when
the candidate contains the legacy database-generation adapter. Under maintenance
custody, candidate Doctor verifies the older updater's entire physical database
inventory and derives committed-content generations from the same observation.
Migration attribution and final settlement use those committed generations;
receipts sent back to the older updater retain its physical fingerprint format.
Each Doctor interval verifies its input again. Changed data, intervening commits,
replaced files, and tampered backups still refuse automatic restoration. The
installed extended-stable updater does not need to contain this repair.
The private rehearsal also preserves the source's legacy cron partition identity
before migrating the copied state. An unmatched historical partition still needs
an explicit Doctor selection.

Within one database-generation observation, update and Doctor workers reuse a
verified digest while the file's device, inode, size, and nanosecond birth,
modification, and change times remain identical. Each family observation still
checks the database, WAL, and rollback journal; private-copy verification and
WAL commit checks remain in place. Changed or unavailable identities require
hashing again. Reuse ends with that observation and does not cross Doctor
invocations. Reuse also requires nanosecond bigint stat fields and modification
and change times more than two seconds older than the start of hashing. Recent
writes can share a coarse filesystem timestamp even when nanosecond fields are
available, so their digests are recomputed. Millisecond-only stats never enable
reuse. The runtime performing the observation must contain this change;
a newer candidate cannot change an older installed updater's own reads.

Update snapshots and database backups accept a database whose only integrity
findings are `malformed inverted index` reports on canonical, schema-validated
agent FTS tables. A Node upgrade that changes SQLite tokenization (for example,
SQLite 3.54) produces exactly these findings on an intact database, and the
runtime that next admits the copy rebuilds the indexes. The copies keep the
original index bytes, so rollback to the previous runtime restores its own
index. Unknown FTS definitions and findings mixed with any other damage still
refuse the update. The candidate performs the rehearsal snapshot, so this applies
from the first update to a candidate with the fix; activation-time backups need
the installed updater to contain it.

Memory embedding migrations space maintenance renewals from the completion of
each renewal, so slow renewals leave time for conversion work. The candidate must
contain this fix; it does not change an older migration already running.

On macOS, reinstall and uninstall reconcile the launchd registration by service
label even if its plist was deleted. Reinstall warns when the previous definition
is missing; an existing plist and its private environment files remain backed up
for rollback if activation fails.

Update-time service reconciliation also removes the historical macOS
`NODE_EXTRA_CA_CERTS=/etc/ssl/cert.pem` setting when the candidate installer retires
it. This requires the candidate to contain the repair and the installed updater
to delegate service refresh to that candidate. Custom CA bundles at other paths
remain preserved, and unknown operator edits still require manual repair.

For existing managed Gateway and node-host services, migration makes a one-time,
best-effort copy of eligible operator CA additions into
`<state directory>/service-ca/<service label>-operator-ca.pem` (mode `0600`).
It reads the installed service's effective CA setting, so its custom trust need
not be present in the updater shell. A distinct CA bundle already selected by
the service remains preserved when the installer does not explicitly select a
different bundle. An explicitly selected distinct bundle takes precedence.

Automatic eligibility is deliberately narrow: the legacy file must retain the
complete, byte-identical historical OpenBSD `1.22.2.1` stock prefix (333483 bytes,
SHA256 `9dae8d76e55cb08991f2b672d58999ea15560d910759c16b544f843bdffbb994`),
as observed in Apple's sealed macOS 27.0.1 template, followed by appended PEM
certificates. Only appended self-signed CA roots with recognized clean native
trust results are eligible. Self-signature alone does not establish provenance.
Stock keys, known compromised keys and any explicit macOS distrust are excluded,
including alternate certificates with the same public key. Native checks include
user, administrator and system trust settings and offline Basic X509 evaluation.
Other stock revisions, replaced or reordered bundles, intermediate-only additions,
unknown native results and unresolvable distrust require manual review.

Migration never changes `/etc/ssl/cert.pem` or overwrites a conflicting operator
file. The CLI reports successful, unnecessary, ambiguous or failed migration,
including partial migration where some additions cannot be established as
eligible. Ambiguity, unavailable provenance or a write failure does not block
the update: the obsolete override remains retired, and dependent private HTTPS
or WSS connections may stop working. Review the guidance before relying on
automatic recovery. Previously working connections that require compromised
keys intentionally remain rejected.

After migration, rotate legitimate private CAs in the maintained bundle and
restart the service. OpenClaw does not synchronize future changes from the
retired file or continuously rescreen this operator-owned bundle against OS
trust changes. For manual recovery, create a distinct maintained PEM bundle,
select its absolute path with `NODE_EXTRA_CA_CERTS`, then run
`openclaw gateway install --force` or `openclaw node install --force` from that
environment. Never restore the entire obsolete stock bundle
or disable certificate verification to recover connectivity.

When reconciliation replaces the service's Node executable, its leading runtime
directory in `PATH` can move to the selected Node directory. Every other existing
`PATH` entry must remain in order; this does not discard custom directories.

When an updater stops a macOS LaunchAgent, it waits for both launchd's process
and the verified serving Gateway child to exit before continuing. An unloaded
job or a closed listener does not prove that the child has released its agent
databases. Pending process cleanup produces a warning and shares the existing
bounded stop deadline; other processes using the state still receive Doctor's
maintenance refusal. The updater performing the stop must contain this fix.

Candidate state workers drop advisory progress when stderr is temporarily full.
Dropped writes do not consume the legacy progress budget, so reporting resumes
when the pipe becomes writable. The worker must contain this repair; it does not
change an older worker that is already running.

Package verification checks file hashes, sizes, and required executability. When
a non-executable dist file gains execute bits, verification continues with one
warning listing the affected file count, provided it has no group/world write or
setuid/setgid/sticky bits. Other permission differences retain their existing
behavior, including owner-only recovery modes. File permissions are left
unchanged. Missing required executability, changed content, and unsafe file types
still fail verification. The installed updater must contain this fix; a newer
candidate cannot change an older updater's package verification.

Content-inventory diagnostics distinguish malformed metadata, content mismatches,
and executable-permission mismatches in local errors and prepared public reports.
They identify the failed check, not the underlying cause or affected file. Public
reports still omit private paths and hash values. The installed updater must
contain this diagnostic change; older updaters and recorded generic errors keep
their original diagnostics.

Supervisor-managed migrations also validate Doctor's repairable projection before
rejecting retired config fields such as `agents.defaults.heartbeat`. They preserve
the original config and database backups before Doctor migrates the state and
converts heartbeats to Automations. Unknown keys and invalid heartbeat settings
still refuse admission. Repeating the migration preserves the converted jobs and
does not repeat the heartbeat delivery notice.

Before replacing a Git checkout's build or an installed package, the updater
retains its running runtime. Late module imports and background workers keep
using that generation through finalization, rollback, and CLI cleanup, even when
the new build has different chunk filenames. The new Gateway starts from the
activated build.

This retention covers Node and Bun late imports, including CommonJS dependencies
and JSON. Module state already loaded by the updater stays shared through cleanup;
imports outside that retained generation continue using the active installation.

Source updates qualify the installed pnpm launcher outside the checkout so even
its version probe cannot rewrite the checkout's lockfile. If another version is
needed, the updater uses a temporary Corepack shim or npm-installed pnpm matching
the checkout's pin. This requires the installed updater to contain the fix;
staging a newer candidate does not change an older updater's initial probe.

Candidate pnpm installs use a project-local virtual dependency graph while
reusing the configured package store. This also applies when pnpm uses hoisted
links: pnpm 12 can otherwise materialize unpatched package bytes from a global
graph despite recording a patch hash. After source exposure changes dependency
topology, the updater refreshes bundled plugin links before final candidate
validation. The refresh links the packages it finds in each plugin's
`node_modules`. A link whose target is missing produces a warning and is skipped
when the plugin declares that package optional; any other broken link or
filesystem error stops preflight. The refresh does not check for dependencies
that were never installed.
These preparation changes require the installed updater to contain the fix;
staging a newer candidate cannot change an older updater's initial install.

Native pnpm package swaps preserve platform-filtered optional dependencies as
absent. On Windows, a dangling link declared in its owner's
`optionalDependencies` is removed from the staged copy instead of failing
activation; missing required dependencies and other filesystem errors still
fail. This requires the installed updater to contain the repair. A failed swap
before any installation or service mutation records the previous Gateway
observation without restart verification, including with `--no-restart`.

Source candidates bound the native declaration compiler with the shared Go runtime
policy used by local checks. Node's heap limit does not cover that compiler.
Explicit `GOMEMLIMIT`, `GOGC`, and `GOMAXPROCS` tuning remains in effect.

Managed update helpers route diagnostic logs to stderr so debug logging cannot
interrupt their control handshake. This applies to the installed updater; a newer
candidate cannot change an older updater's pre-activation handshake.

If native service inspection becomes unavailable after admission, the updater
refuses activation before stopping the Gateway or replacing its package. When
inspection is unavailable initially, a live or unverified Gateway state owner
also blocks package replacement, even if the process title no longer contains
its installation path. The refusal leaves the installation unchanged and names
the service inspection and stop commands to use before retrying.

Before stopping a managed Gateway, the updater waits up to 30 seconds for foreign
SQLite maintenance to finish. If it remains busy, activation is deferred and the
Gateway stays running. Recovery checks after shutdown use the same bounded wait;
if maintenance still does not finish, the existing rollback path restores the
previous build. The refusal names the maintenance process and tells you to let
it finish before retrying `openclaw update`. An explicit update timeout and
cancellation still bound these waits; live ownership and recovery checks remain
required before activation.

The updater retains its admitted SQLite writer wait allowance through finalization,
including candidate handoff and standalone repair. A writer that outlasts SQLite's
ordinary wait can finish before required recovery evidence and the final outcome
are recorded. Optional history bookkeeping still uses its short wait and warns
without stopping the update. This applies to the installed updater; the candidate
also preserves the step allowance passed by older installed updaters.

`openclaw update status` reports confirmed driver loss without changing the
recorded run, and names `openclaw update repair` as the next action. Repair or the
next update's admission can record the failed outcome without waiting for the
inactivity grace period. Live or unverifiable drivers and retained recovery
continue to preserve their ownership.

If an explicit update timeout expires during preparation, the original updater
records a failed outcome after its child work settles, while it still owns
bookkeeping. Expiration during activation, unresolved child work, or lost
ownership retains recovery custody instead. A timeout does not authorize a new
process to take over an unresolved update.

When both the managed-update helper and updater are proven dead, explicit
`openclaw update repair` can reclaim their handoff immediately; unknown custody
keeps the 45-minute (or longer recorded) grace. The descendant census still
refuses live or unverified work. After finalization succeeds, repair starts and
verifies the managed Gateway only when update history records that the helper
or updater stopped it without a subsequent start, running observation, completed
managed restart, or settled run. Both recovery owners use this same decision. A Gateway
stopped by its operator stays stopped. A recorded named data risk prevents
automatic startup. The repairing CLI must contain this fix; older managed-service
activation records can establish the stop without a new stop-time receipt.

Explicit repair also settles version-2 triage/repair leases left in `closing`
after their owners die, even without recovery metadata. Native triage still
requires proof that its systemd scope is closed. Repair warns when reclaiming a
lease; if an owner, descendant, or scope remains live or unverified, it fails with
the retained lease's owner, version, phase, last activity, and recovery guidance.
The repairing CLI must contain this fix; a downloaded update candidate cannot
repair an older updater's blocked admission.

Explicit repair uses the package journal's verified historical lease store when
it still exists, so uncertain-handoff recovery and publication settlement share
one repair claim even when the default per-user store is empty. Recovery checks
and ordinary update admission remain unchanged. The repairing CLI must contain
this fix; no lease schema or update protocol change is required. When an older
CLI is blocked, install a CLI with this fix through the
[manual procedure](/install/updating/update-methods#alternative-manual-npm-pnpm-or-bun)
and run the repair while the Gateway is stopped; a Gateway started during the
handoff's recovery grace counts as possible handoff work and keeps repair refusing.

A successful foreground update hands completion to the replacement Gateway.
Automatic history reconciliation preserves that handoff while startup verifies
the running build. If the replacement never starts, `openclaw update repair`
can recover the abandoned handoff explicitly.

Handoff repair uses recorded boot sessions and process creation times to exclude
prior-boot families and unrelated processes with reused parent PIDs. On Windows,
a legacy handoff without a boot identity also qualifies as prior-boot when its
durable write is more than five minutes before the current boot started. Unverified
descendants and incomplete process censuses block settlement to prevent overlapping
updaters. Positive handoff descendants, OpenClaw identities, and retained-runtime
path holders also block repair. This does not relax Doctor's artifact-custody
checks or remove retained recovery data.

Authenticated readiness probes recheck the update's live ownership before opening
their transport and sending RPC frames, including deferred authentication and
startup retries. Losing ownership stops those probes.

If the retained verifier cannot authenticate to the restarted Gateway, it stops
retrying that rejection. Local HTTP readiness and runtime version/build identity
can verify activation instead, with an RPC authentication warning recorded in
the update result. This does not change Gateway authentication or pairing.
The retained verifier runs the previous package, so an update that changes the
Gateway protocol version, in either direction, gets the same HTTP identity check
with an RPC protocol warning instead of waiting for an RPC handshake that cannot
succeed. When readiness never settles, the recorded timeout names both the read
the budget interrupted and the last health probe error, such as an RPC
rejection.

Channel outages are warnings once the expected Gateway build is running and its
core readiness is verified. Detailed `/readyz` responses report `coreReady`
separately while preserving HTTP 503, `ready: false`, and failing channel names.
Update history retains those channel and HTTP facts. Startup, state and agent
database admission, child-runtime, and plugin-replacement failures still prevent
core readiness; an older HTTP 503 without explicit core proof remains unverified.
Run `openclaw channels status --probe` to investigate channel warnings. This
requires the repaired installed updater; a new candidate cannot change the
checks of an updater already running.

Before post-core plugin work, the updater releases its temporary Doctor database
ownership before rechecking profile-backed requester authority. Service custody
remains with the updater; the next Doctor acquires its own database ownership.
This avoids refusing the updater's own policy reads during its maintenance window.

Plugin lifecycle work in update finalization and repair renews its lease from a
worker, so a blocked main thread cannot expire the lease. Native Doctor and plugin
install/update operations share this renewal behavior. Ownership checks,
cancellation, and release still apply. The runtime holding the lease must contain
this fix; a newer candidate cannot change an already-running lease owner.

When standalone Doctor stops its managed Gateway, it reserves Gateway restoration
before releasing database maintenance. CLI schema preparation waits while Doctor
restores and verifies the Gateway; Gateway bootstrap keeps its normal ownership
checks. Doctor and competing CLI processes must contain this repair. Already-running
older processes cannot observe the reservation.

Candidate-side predecessor shutdown retains its durable recovery receipt inside
Doctor's original database-write capture. When the receipt owner acquires exclusive
maintenance custody, Doctor reconciles writes made while stopping the predecessor.
Changed captured SQLite databases produce a warning and forward repair continues
from current state; automatic restoration of the stale backup stays disabled.
This also accepts foreign writes made before custody, preserving their data rather
than restoring over them. Later changes still refuse receipt attribution or migration.
The ledger writer includes its own native connection close before publishing that
write; the following Doctor rechecks the database before reacquiring native custody.
A completed stop keeps its recovery receipt even when a later refusal prevents
Doctor from continuing. A loaded supervised service between crashed processes
still goes through native service-ownership inspection, even without a live lease.
The candidate must contain this repair; the installed updater needs no protocol change.

After a Doctor child settles, the updater drains its retained handles for the
affected shared-state database and revokes their schema admission, even when
Doctor exits unsuccessfully. The next parent access admits the resulting schema
again and refuses a version newer than the running updater supports.

Before Doctor admits the installed updater's database capture, plugin rollback
journal discovery preserves the original SQLite WAL/SHM family. Older updaters
can then verify their physical fingerprints without a false source-change refusal.

Plugin rollback reservation acquires its lease against the existing shared-state
schema, then database capture records the settled reservation writes. Credential
migration remains owned by candidate Doctor's backed-up maintenance.
Starting or restarting an unchanged service does not require migrating runtime-pin
metadata; definition rewrites still preserve existing runtime intent.
Failed split-install activation also keeps recovery results valid when restoring
the original service is unverified. These fixes must be in the installed updater;
downloading a candidate cannot change the older driver's reservation or reporting.

After Doctor backs up and admits shared-state maintenance reads, native Codex
assignment detection reads one database transaction snapshot. Lease renewals and
other maintenance writes can continue without requiring the database files to
stop changing for a private copy. Inspection without that admission still uses
an artifact-preserving copy and refuses an inconsistent source. This is
candidate-side behavior; the installed updater runs first with its shipped checks.

During update finalization, disposable plugin source copies and private SQLite
inspection snapshots use the candidate helper's absolute `TMPDIR` (including
when an older installed updater starts that helper). Normal Gateway cache
placement is unchanged. Installed plugin projects, retained native admissions,
and recovery or migration backups remain with their existing durable owners;
`TMPDIR` does not relocate those writes or remove the need for free space on the
installation and state filesystems.

Plugin source capture repairs stale dependency links without changing real
dependency directories. POSIX replacements are staged before publication;
Windows removes only the junction or symlink before recreating and verifying it.
A failed link leaves that plugin unprepared with a named error. Doctor retains
its pending migration obligation while other plugins' migrations continue.
This repair applies when the candidate loads plugin contracts during Doctor.

Before judging an npm destination whose package path is empty, the updater
restores a package link that a killed update left under
`.openclaw.package-backup-<pid>-<time>`, but only when that link resolves to the
checkout running the update. The destination is then inspected as usual and the
update continues as an ordinary switch from a dev checkout to a package. Links to
other checkouts and retained package directories are not moved. The installed
updater must contain this fix; without it the retry is refused as an
uninspectable destination until the link is moved back by hand. No journal,
schema, or protocol change is involved.

Update cleanup retires the pre-migration `.databases` snapshot directory of an
earlier update once a later update is verified successful. It finds a snapshot
only through the location that update recorded in update history, including one
under a previous install root, and deletes nothing an unfinished update or a
pending recovery owns. This includes the snapshots that older updaters left in a
Git checkout's `.artifacts` directory. Update history holds no usable location for
a checkout outside the home directory; those snapshots stay. A verified update's own retained snapshot waits for the
next verified update. The installed updater or Gateway that finishes the later
update must contain this change; no schema, journal, or protocol change is
involved.

### Migration integrity checks

Cold update-history bookkeeping verifies shared-state integrity before acquiring
the SQLite writer. The full check still runs, but a serving Gateway can continue
writing while it scans. Ledger changes and current ownership/schema checks remain
transactional; explicit maintenance and orphan recovery retain their existing
transaction-local verification.

SQLite upgrades default to a whole-database `quick_check`, a full
`integrity_check` of the tables the migration rewrites or re-indexes, and the
existing foreign-key checks. This avoids checking every unrelated index against
its table during a routine upgrade. An agent database version step checks only the
schema catalog and the tables it declares, so upgrade downtime does not grow with
unrelated agent history; the next Gateway start checks the whole database in the
background. Other structural corruption and corruption in the migration's affected
tables still refuse the migration; quarantine and rollback behavior are unchanged.
Historical upgrades use the same default even when recovery requires a full-file
backup. Automatic original-state captures and disposable update rehearsals also
honor the requested check, including same-version Doctor repairs. Automatic rollback
images, restore validation, explicit Doctor recovery, and legacy transformed recovery
archives retain full integrity checks.

To request full integrity checking across every table and index during migration:

```bash
openclaw doctor --fix --full-integrity-check
```

Prepared-release updates (Git and npm, pnpm or Bun installs) refuse
`openclaw update --full-integrity-check` before creating an update run. They do
not support this selection. Run the Doctor command above separately when you
need full migration checks, then update without the flag. Doctor does not turn
an already-current database into a separate verification job.

The default can miss an index/table mismatch in an untouched table. Use the full
check when you need that coverage; it can take considerably longer on large
databases. A successful quick check is never recorded as a full verification.
Ordinary post-migration Doctor/update opens with no seal use bounded admission
when the agent schema is current and there is no corruption evidence. They retain
that file-bound admission across same-process reopens, including an incomplete
checkpoint, without claiming a full verification or publishing a seal. The next
Gateway startup runs full integrity and foreign-key verification in the
background; readiness does not wait for it. Proven corruption revokes admission.
Required index repairs, rejected proof, crash recovery, revoked validation, and
explicit FULL policy retain their required checks. Whole-file checks required by
synchronous agent openers run in the integrity child. Pending migrations still
require their scoped pre-mutation checks, and update canaries retain foreground
verification.
The flag selects migration checks; it does not turn an already-current database
into a separate verification job. Explicit database verification, backup
verification, Doctor recovery, and compaction retain their existing checks.

The installed updater runs first. Its own captures and checks keep their shipped
behavior; the more efficient default begins when the candidate runs its
migrations. An older installed CLI does not recognize the new flag. For that
first upgrade, update normally to receive the candidate's new default, or run
the candidate's `doctor --fix --full-integrity-check` through your manual upgrade
workflow.

Post-activation schema verification preserves agent databases Doctor holds after
deletion. These stores may keep an older schema without failing the update;
Doctor's held-store warning remains visible. Configured agents required by the
Gateway must still pass runtime admission: Doctor fails if a recovery hold
leaves a required store unusable. Active databases and pending deletions require
the candidate schema, and held stores remain part of rollback verification.
Retained plugin databases, including plugin shared-state stores, are not checked
against the agent schema. Their plugin owns migration; they remain in the
snapshot and rollback inventory even when the plugin is disabled. The primary
shared-state database is checked against the shared-state schema.

The local client credential cutover preserves private identities and cached tokens
in `client/credentials.sqlite`, separate from shared Gateway state. The preparatory
release does not create that file. Earlier SQLite drivers capture the shared
credential tables before the cutover and restore them on automatic rollback; the
old version ignores the remaining local file. Credentials issued between upgrade
and rollback are lost, and those clients must pair again. A later upgrade rebuilds
that stale local file from restored shared state instead of merging it. PostgreSQL
installations use an engine-aware driver with local-family capture support, so
rollback restores the shared and local stores together. See
[credential migration and recovery](/reference/database-schemas/versioning#local-client-credentials).

Updates started by 2026.10.4 keep the client credential store's independent
schema out of the older updater's agent-schema check. Credential-aware updaters
verify that store against its own schema, and both paths retain its backup and
recovery coverage.

Independent native credential sources remain unchanged during import and remain
readable by the previous app after rollback. Reusing the same source preserves
local refreshes; a changed or restored source rebuilds its local copy while
retaining consumed legacy-JSON claims.

OpenClaw.app runs plugin convergence through the selected runtime's Doctor while
the app owns Gateway activation. This aligns managed official npm plugins with the new
core before plugin migrations, repairs host peer links, and refreshes the plugin
registry. Unavailable replacements remain nonblocking: the app's recovery
diagnostics include the remaining version or peer-link warning and the exact
repair command. Retry Gateway setup in the app to repeat this owned repair.
