Skip to content

fix: shorten the first update's outage by skipping an idle second Doctor - #206227

Merged
fuller-stack-dev merged 3 commits into
openclaw:mainfrom
fuller-stack-dev:fix/first-update-skip-idle-retirement-doctor
Nov 27, 2026
Merged

fuller-stack-dev merged 3 commits into
openclaw:mainfrom
fuller-stack-dev:fix/first-update-skip-idle-retirement-doctor

Conversation

@fuller-stack-dev

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

Copy link
Copy Markdown
Member

Related: #204775

What Problem This Solves

Updating from a published release (for example 2026.11.10) to this release runs this release's Doctor twice while the Gateway is stopped. The second run started on every such update: the first Doctor always recorded "model retirement deferred until configured plugin installation converges", and that recorded deferral makes the updater start a second Doctor after plugin convergence. On an install with no plugin to converge and no model reference to retire, that second Doctor repeated config and chat-history checks and changed nothing. It cost 6 to 7 s of outage on Linux and 46 to 53 s on Windows Server (2 vCPU).

User Impact

A first update from a published package no longer runs the idle second Doctor, so the Gateway is back sooner. The repairs and migrations are the same: the resulting schema versions, config, database row counts and a chat turn through the restarted Gateway match the build without this change. When retirement or stale plugin config repair does have work, or a plugin install can still change during convergence, the update waits and runs the second Doctor as before.

Why This Change Was Made

The model retirement owner (runDoctorRepairSequence) already knows, at the moment it records the deferral, everything the second Doctor would decide on: the second Doctor starts from the config the first one writes, and with no install record and no pending install repair the plugin inventory cannot change in between. So before recording the deferral it now runs the three repairs the second pass would run (stale plugin config, implicit OpenAI primary, stale model references) on a private copy of the candidate config, in the same order. It records the deferral only if one of them would change or warn, or if convergence can still change plugins: any install record, install repair change, warning or notice, a failed plugin install, or explicit model replacements. No new stored field, flag or protocol: the post-core decision (completePostCorePluginUpdate) keeps reading the existing ledger step, which simply is not written when there is nothing to wait for.

Cost: the private-copy check adds about 0.5 s inside the first Doctor (the "Config repairs" phase went from under 0.3 s to 0.8 s in the cells).

Update behavior. The installed 2026.11.10 runs the update. With the Gateway stopped it calls this release twice: infra/update-migrated-finalize.worker.js --doctor (the first Doctor, through 2026.11.10's runPackageUpdateDoctor), then --post-core, which runs this release's openclaw update continuation. This change is in the first call: the first Doctor no longer records the deferral when nothing waits on convergence. The second call reads that ledger and, with plugins unchanged, no longer starts the second --doctor (and its capability probe). Nothing in the installed updater changes; any published driver that hands off to this release's post-core gets the shorter stop on its first update. Updates driven by this release's own path are unaffected unless they set the package-swap marker, and then the same rule applies.

Where the first update's outage goes (Linux, before)

Installed published 2026.11.10 (npm global, systemd user Gateway), candidate main packed as an unpublished version, /readyz probed every 250 ms, run record step times, ms-stamped updater stderr. 4 GiB agent database with 1 MiB/s of writes while serving (cell G-base.1):

Inside the stop Who runs it Seconds
Service stop, post-stop checks installed 2026.11.10 0.5
Database snapshot installed 2026.11.10 14.7
Config snapshot and Doctor setup installed 2026.11.10 5.2
Doctor 1: --doctor, called by 2026.11.10 this release 57.8
of which: schema admission 3.7, maintenance begin 3.7, database migrations 20.8, config flow 8.1, contributions 10.2, maintenance finish 4.0
Handoff: --post-core, called by 2026.11.10 this release 6.4
Plugin convergence, config validation, readiness lint this release 4.2
Doctor 2: retirement-only --doctor, called by this release's post-core this release 6.7
Service reinstall and restart this release 3.2
Gateway start to ready this release 7
Not serving 107.2

Doctor runs twice inside the stop on Linux too, as on Windows. Doctor 1 is the real migration. Doctor 2 ran only because of the recorded deferral: plugins were unchanged (finalize:plugins:0, retirement-only selection) and it changed nothing.

Ranked by seconds the new release can remove without the installed updater:

  1. Doctor 2 (this PR): 6 to 7 s on Linux at any store size, 46 to 53 s on Windows (its section times there: config flow 13 to 17 s, chat history 20 to 21 s).
  2. Repeated chat-history scan in Doctor 2: covered by 1. The existing scan-reuse receipt (improve(doctor): updates scan retained transcripts once instead of twice #177933) cannot help this hop: Doctor 1's receipt goes to the installed 2026.11.10 parent, not to this release's post-core.
  3. Doctor 1 itself (21 to 59 s): database migrations are the schema change itself, and config flow and contributions run once per update. I found nothing there that repeats work or that a later step could prove done, so it is not changed here.

Evidence

Driver for every cell: published 2026.11.10 from npm. Base candidate: main (red at 3495c164737, comparison base at fcc9a0648c2), packed as 2026.11.13. Head candidate: this PR's production code at 474dce4fafa, packed as 2026.11.14 (later commits on the branch change one test and merge main; no Doctor or update path file moved, checked with git diff --name-only). Every run: openclaw update --yes --json exit 0, run record succeeded, Gateway serving the candidate afterwards.

Cell Candidate Agent DB Not serving Doctor 1 (installed updater calls --doctor) Doctor 2 (post-plugin, new release) Post-update verification Stop to restart Run
E-base.1 2026.11.13 3495c164737 0 MiB 56.5 s 24.1 s 6.7 s 11.0 s 47.0 s succeeded
E-base.2 2026.11.13 fcc9a0648c2 0 MiB 50.4 s 21.5 s 6.0 s 9.9 s 41.8 s succeeded
E-base.3 2026.11.13 fcc9a0648c2 0 MiB 50.5 s 21.4 s 5.9 s 9.9 s 41.9 s succeeded
E-head.1 2026.11.14 474dce4fafa 0 MiB 50.9 s 23.9 s not run 4.4 s 40.8 s succeeded
E-head.2 2026.11.14 474dce4fafa 0 MiB 50.9 s 24.4 s not run 4.5 s 40.5 s succeeded
E-head.3 2026.11.14 474dce4fafa 0 MiB 43.8 s 21.1 s not run 3.5 s 35.5 s succeeded
G-base.1 2026.11.13 3495c164737 4096 MiB 107.2 s 57.8 s 6.7 s 10.9 s 97.4 s succeeded
G-base.2 2026.11.13 fcc9a0648c2 4096 MiB 108.7 s 59.2 s 6.6 s 11.1 s 99.3 s succeeded
G-head.1 2026.11.14 474dce4fafa 4096 MiB 99.1 s 58.5 s not run 4.0 s 90.3 s succeeded
G-head.2 2026.11.14 474dce4fafa 4096 MiB 93.6 s 51.9 s not run 4.0 s 83.5 s succeeded
R-base.1 2026.11.13 fcc9a0648c2 0 MiB + anthropic/claude-sonnet-4-5 60.7 s 25.0 s 8.0 s 13.7 s 49.8 s succeeded
R-head.1 2026.11.14 474dce4fafa 0 MiB + anthropic/claude-sonnet-4-5 49.9 s 24.0 s not run 4.8 s 40.5 s succeeded
N-base.1 2026.11.13 fcc9a0648c2 0 MiB + ghost-provider/model-a 68.5 s 26.1 s 11.5 s 17.0 s 56.9 s succeeded
N-head.1 2026.11.14 474dce4fafa 0 MiB + ghost-provider/model-a 100.9 s 36.1 s 23.8 s 31.6 s 89.3 s succeeded
F-base.1 2026.11.13 fcc9a0648c2 0 MiB + ghost-provider/model-a anthropic/claude-sonnet-4-5 52.4 s 21.5 s 6.7 s 11.2 s 43.7 s succeeded
F-head.1 2026.11.14 474dce4fafa 0 MiB + ghost-provider/model-a anthropic/claude-sonnet-4-5 73.5 s 27.9 s 7.5 s 12.6 s 63.7 s succeeded

In every head cell without a reason to wait, Doctor 2 did not run and post-update verification (the stretch that contains it) went from 9.9 to 13.7 s to 3.5 to 4.8 s. Not serving, base vs head: empty state 50.4, 50.5 and 56.5 s vs 43.8, 50.9 and 50.9 s (the ranges overlap; on this host identical cells differ by up to 7 s); 4 GiB store 107.2 and 108.7 s vs 93.6 and 99.1 s; configured model 60.7 vs 49.9 s. The N and F controls take the same path on both sides and still differ by 21 to 32 s: that is host load from other work on the machine (every phase of those head cells is slower, including the installed updater's own database snapshot), not this change.

Cells E and G are an empty state and a 4 GiB agent database under 1 MiB/s of writes. R has a configured model with an available provider (anthropic/claude-sonnet-4-5), the usual case for a real install.

Same repairs and migrations (state after each update, base vs head): for every pair, all five databases have the same user_version (agent 45, state 42, quarantine 2, credentials 1, services 1), identical schema hash and identical row counts per table; the config file is identical apart from the port, which is random per cell, and the wizard timestamp; chat.inject through the restarted Gateway succeeds and chat.history returns both the new marker and the one written before the update.

Negative controls (state that really needs the second Doctor):

  • N cells: agents.defaults.model.primary names a provider that does not exist. Head still records finalize:doctor:model-retirement as deferred, runs the second Doctor, and leaves the same config and databases as base.
  • F cells: the same unavailable primary with an available fallback, so retirement has a real change to make. Head defers, runs the second Doctor, and the retired reference ends in the same config as base: agents.defaults.model.primary is replaced with anthropic/claude-sonnet-4-5 and finalize:doctor:model-retirement is completed on both sides.
  • Unit tests: a stale model reference, a provider inventory warning, a stale plugin entry and an existing plugin install record each keep the deferral and leave the candidate config untouched; nothing to change records no deferral.

Recordings (replays of the raw cell output; timestamps and values come from the logs below):

Red (base):
https://github.com/user-attachments/assets/b352aabf-3cce-4611-ad03-7d279addc06c

Green (head):
https://github.com/user-attachments/assets/e22354ec-0f1e-4ef7-b93f-9a45c44e071b

Controls:
https://github.com/user-attachments/assets/8d4977f6-3227-4a2a-b5e0-6f9b955ac1b1

Raw: per-cell split (run record steps, systemd, /readyz)
== E-base.1 u1: exit 0 wall 130.6 s
not serving:    40.8 ->    97.2 = 56.5 s
  start     end   secs  what
    3.0    15.1   12.1    run step: requested
   15.1    15.1    0.0    run step: staging
   15.1    40.0   24.9    run step: validating
   15.6    24.8    9.2    run step: updater-runtime-retention
   28.3    29.1    0.7    run step: candidate-recovery
   38.2    38.5    0.3    run step: previous gateway verification
   40.0    87.7   47.7    run step: activating
   40.7    41.0    0.3    run step: service-stop
   40.7      systemd: Stopping openclaw-gateway
   41.0    * systemd: Stopped openclaw-gateway
   41.2    41.3    0.1  * run step: post-stop-checks
   41.7    43.0    1.3  * run step: database snapshot
   48.5    72.6   24.1  * run step: openclaw doctor
   49.8    72.4   22.6  * Doctor run 1 (stderr progress, first 'Update schema admission')
   72.6    72.6    0.0  * run step: database migration writes
   72.6    75.6    3.0  * run step: update-driver-handoff
   76.5    87.5   11.0  * run step: post-update verification
   78.7    84.4    5.7  * Doctor run 2 (stderr progress, first 'Update schema admission')
   84.5    84.5    0.0  * Doctor run 3 (stderr progress, first 'Update schema admission')
   87.7    90.7    3.0  * run step: restarting
   87.7    87.9    0.2  * run step: managed-service-executor-check
   87.9    90.6    2.7  * run step: managed-service-install
   90.5    * systemd: Started openclaw-gateway
   90.7   103.3   12.7  * run step: verifying
   97.7    97.7    0.0    run step: gateway verification
  183.1      systemd: Stopping openclaw-gateway
  183.3      systemd: Stopped openclaw-gateway

== E-base.2 u1: exit 0 wall 119.6 s
not serving:    39.1 ->    89.5 = 50.4 s
  start     end   secs  what
    2.9    14.7   11.8    run step: requested
   14.7    14.7    0.0    run step: staging
   14.7    38.2   23.5    run step: validating
   15.2    23.7    8.4    run step: updater-runtime-retention
   27.0    27.7    0.7    run step: candidate-recovery
   36.7    36.9    0.3    run step: previous gateway verification
   38.2    80.7   42.5    run step: activating
   38.9    39.1    0.3    run step: service-stop
   38.9      systemd: Stopping openclaw-gateway
   39.1    * systemd: Stopped openclaw-gateway
   39.3    39.4    0.1  * run step: post-stop-checks
   39.8    40.8    1.0  * run step: database snapshot
   45.7    67.1   21.5  * run step: openclaw doctor
   46.8    66.9   20.1  * Doctor run 1 (stderr progress, first 'Update schema admission')
   67.1    67.1    0.0  * run step: database migration writes
   67.1    69.8    2.6  * run step: update-driver-handoff
   70.7    80.6    9.9  * run step: post-update verification
   72.7    77.8    5.1  * Doctor run 2 (stderr progress, first 'Update schema admission')
   77.9    77.9    0.0  * Doctor run 3 (stderr progress, first 'Update schema admission')
   80.7    83.4    2.7  * run step: restarting
   80.7    80.9    0.2  * run step: managed-service-executor-check
   80.9    83.4    2.4  * run step: managed-service-install
   83.3    * systemd: Started openclaw-gateway
   83.4    95.2   11.8  * run step: verifying
   89.8    89.8    0.0    run step: gateway verification
  171.6      systemd: Stopping openclaw-gateway
  171.8      systemd: Stopped openclaw-gateway

== E-base.3 u1: exit 0 wall 118.5 s
not serving:    38.1 ->    88.6 = 50.5 s
  start     end   secs  what
    2.5    14.1   11.5    run step: requested
   14.1    14.1    0.0    run step: staging
   14.1    37.4   23.3    run step: validating
   14.6    23.1    8.5    run step: updater-runtime-retention
   26.4    27.1    0.6    run step: candidate-recovery
   35.8    36.1    0.3    run step: previous gateway verification
   37.4    79.9   42.6    run step: activating
   38.0    38.3    0.3    run step: service-stop
   38.0      systemd: Stopping openclaw-gateway
   38.3    * systemd: Stopped openclaw-gateway
   38.4    38.5    0.1  * run step: post-stop-checks
   38.9    39.9    1.0  * run step: database snapshot
   45.0    66.5   21.4  * run step: openclaw doctor
   46.1    66.3   20.2  * Doctor run 1 (stderr progress, first 'Update schema admission')
   66.5    66.5    0.0  * run step: database migration writes
   66.5    69.0    2.6  * run step: update-driver-handoff
   69.9    79.8    9.9  * run step: post-update verification
   71.9    77.0    5.0  * Doctor run 2 (stderr progress, first 'Update schema admission')
   77.0    77.0    0.0  * Doctor run 3 (stderr progress, first 'Update schema admission')
   79.9    82.7    2.7  * run step: restarting
   79.9    80.1    0.2  * run step: managed-service-executor-check
   80.2    82.6    2.5  * run step: managed-service-install
   82.5    * systemd: Started openclaw-gateway
   82.7    93.9   11.2  * run step: verifying
   88.6    88.6    0.0    run step: gateway verification
  171.8      systemd: Stopping openclaw-gateway
  172.1      systemd: Stopped openclaw-gateway

== E-head.1 u1: exit 0 wall 127.2 s
not serving:    38.0 ->    88.9 = 50.9 s
  start     end   secs  what
    2.6    13.9   11.3    run step: requested
   13.9    13.9    0.0    run step: staging
   13.9    36.8   22.9    run step: validating
   14.4    22.6    8.1    run step: updater-runtime-retention
   26.1    26.8    0.7    run step: candidate-recovery
   35.1    35.3    0.3    run step: previous gateway verification
   36.8    78.6   41.8    run step: activating
   37.8    38.2    0.4    run step: service-stop
   37.8      systemd: Stopping openclaw-gateway
   38.1    * systemd: Stopped openclaw-gateway
   38.4    38.5    0.1  * run step: post-stop-checks
   39.0    40.2    1.2  * run step: database snapshot
   46.3    70.3   23.9  * run step: openclaw doctor
   47.6    70.1   22.6  * Doctor run 1 (stderr progress, first 'Update schema admission')
   70.3    70.3    0.0  * run step: database migration writes
   70.3    73.2    2.9  * run step: update-driver-handoff
   74.1    78.5    4.4  * run step: post-update verification
   78.6    81.9    3.3  * run step: restarting
   78.7    78.9    0.2  * run step: managed-service-executor-check
   78.9    81.9    2.9  * run step: managed-service-install
   81.8    * systemd: Started openclaw-gateway
   81.9    95.5   13.6  * run step: verifying
   89.3    89.3    0.0    run step: gateway verification
  178.7      systemd: Stopping openclaw-gateway
  179.0      systemd: Stopped openclaw-gateway

== E-head.2 u1: exit 0 wall 126.8 s
not serving:    37.8 ->    88.7 = 50.9 s
  start     end   secs  what
    2.7    13.2   10.4    run step: requested
   13.2    13.2    0.0    run step: staging
   13.2    36.9   23.7    run step: validating
   13.8    22.4    8.6    run step: updater-runtime-retention
   26.1    26.8    0.7    run step: candidate-recovery
   35.0    35.4    0.3    run step: previous gateway verification
   36.9    78.0   41.2    run step: activating
   37.5    37.9    0.3    run step: service-stop
   37.6      systemd: Stopping openclaw-gateway
   37.9    * systemd: Stopped openclaw-gateway
   38.1    38.2    0.1  * run step: post-stop-checks
   38.6    39.8    1.2  * run step: database snapshot
   44.8    69.2   24.4  * run step: openclaw doctor
   46.1    69.1   23.0  * Doctor run 1 (stderr progress, first 'Update schema admission')
   69.2    69.2    0.0  * run step: database migration writes
   69.2    72.3    3.1  * run step: update-driver-handoff
   73.4    77.9    4.5  * run step: post-update verification
   78.0    81.3    3.2  * run step: restarting
   78.0    78.3    0.2  * run step: managed-service-executor-check
   78.3    81.2    2.9  * run step: managed-service-install
   81.1    * systemd: Started openclaw-gateway
   81.3    95.4   14.1  * run step: verifying
   88.9    88.9    0.0    run step: gateway verification
  179.3      systemd: Stopping openclaw-gateway
  179.6      systemd: Stopped openclaw-gateway

== E-head.3 u1: exit 0 wall 112.6 s
not serving:    38.1 ->    81.9 = 43.8 s
  start     end   secs  what
    2.6    14.2   11.6    run step: requested
   14.2    14.2    0.0    run step: staging
   14.2    37.2   23.0    run step: validating
   14.7    22.9    8.2    run step: updater-runtime-retention
   26.3    26.9    0.6    run step: candidate-recovery
   35.6    35.9    0.3    run step: previous gateway verification
   37.2    73.3   36.2    run step: activating
   37.8    38.1    0.3    run step: service-stop
   37.9      systemd: Stopping openclaw-gateway
   38.1    * systemd: Stopped openclaw-gateway
   38.3    38.4    0.1  * run step: post-stop-checks
   38.8    39.8    1.0  * run step: database snapshot
   45.1    66.2   21.1  * run step: openclaw doctor
   46.2    66.1   20.0  * Doctor run 1 (stderr progress, first 'Update schema admission')
   66.2    66.2    0.0  * run step: database migration writes
   66.2    68.8    2.6  * run step: update-driver-handoff
   69.7    73.2    3.5  * run step: post-update verification
   73.3    76.0    2.6  * run step: restarting
   73.4    73.5    0.2  * run step: managed-service-executor-check
   73.6    75.9    2.4  * run step: managed-service-install
   75.9    * systemd: Started openclaw-gateway
   76.0    87.7   11.7  * run step: verifying
   82.4    82.4    0.0    run step: gateway verification
  161.2      systemd: Stopping openclaw-gateway
  161.4      systemd: Stopped openclaw-gateway

== G-base.1 u1: exit 0 wall 213.6 s
not serving:    61.4 ->   168.5 = 107.2 s
  start     end   secs  what
    3.1    16.5   13.4    run step: requested
   16.5    16.5    0.0    run step: staging
   16.5    60.3   43.8    run step: validating
   17.1    26.3    9.2    run step: updater-runtime-retention
   29.6    30.3    0.6    run step: candidate-recovery
   39.1    39.3    0.3    run step: previous gateway verification
   60.3   158.5   98.2    run step: activating
   61.1    61.4    0.3    run step: service-stop
   61.1      systemd: Stopping openclaw-gateway
   61.4    * systemd: Stopped openclaw-gateway
   61.6    61.7    0.1  * run step: post-stop-checks
   62.1    76.8   14.7  * run step: database snapshot
   82.0   139.8   57.8  * run step: openclaw doctor
   86.3   139.6   53.3  * Doctor run 1 (stderr progress, first 'Update schema admission')
  139.8   139.8    0.0  * run step: database migration writes
  139.8   146.3    6.4  * run step: update-driver-handoff
  147.3   158.3   10.9  * run step: post-update verification
  149.4   155.2    5.8  * Doctor run 2 (stderr progress, first 'Update schema admission')
  155.3   155.3    0.0  * Doctor run 3 (stderr progress, first 'Update schema admission')
  158.5   161.6    3.2  * run step: restarting
  158.5   158.7    0.2  * run step: managed-service-executor-check
  158.7   161.6    2.9  * run step: managed-service-install
  161.5    * systemd: Started openclaw-gateway
  161.6   178.9   17.2  * run step: verifying
  168.9   169.0    0.0    run step: gateway verification
  264.8      systemd: Stopping openclaw-gateway
  265.1      systemd: Stopped openclaw-gateway

== G-base.2 u1: exit 0 wall 204.1 s
not serving:    52.7 ->   161.4 = 108.7 s
  start     end   secs  what
    2.9    14.7   11.9    run step: requested
   14.7    14.8    0.0    run step: staging
   14.8    51.8   37.0    run step: validating
   15.3    23.4    8.2    run step: updater-runtime-retention
   26.7    27.4    0.7    run step: candidate-recovery
   36.4    36.7    0.3    run step: previous gateway verification
   51.8   151.8  100.0    run step: activating
   52.5    52.8    0.3    run step: service-stop
   52.5      systemd: Stopping openclaw-gateway
   52.8    * systemd: Stopped openclaw-gateway
   53.0    53.1    0.1  * run step: post-stop-checks
   53.5    68.5   15.0  * run step: database snapshot
   74.7   133.8   59.2  * run step: openclaw doctor
   79.6   133.7   54.1  * Doctor run 1 (stderr progress, first 'Update schema admission')
  133.8   133.8    0.0  * run step: database migration writes
  133.8   139.6    5.7  * run step: update-driver-handoff
  140.5   151.6   11.1  * run step: post-update verification
  143.0   148.6    5.6  * Doctor run 2 (stderr progress, first 'Update schema admission')
  148.7   148.7    0.0  * Doctor run 3 (stderr progress, first 'Update schema admission')
  151.8   154.8    3.0  * run step: restarting
  151.8   152.0    0.2  * run step: managed-service-executor-check
  152.1   154.8    2.7  * run step: managed-service-install
  154.6    * systemd: Started openclaw-gateway
  154.8   172.7   17.8  * run step: verifying
  161.6   161.6    0.0    run step: gateway verification
  252.4      systemd: Stopping openclaw-gateway
  252.7      systemd: Stopped openclaw-gateway

== G-head.1 u1: exit 0 wall 212.9 s
not serving:    59.7 ->   158.8 = 99.1 s
  start     end   secs  what
    3.0    15.7   12.8    run step: requested
   15.7    15.8    0.0    run step: staging
   15.8    58.9   43.2    run step: validating
   16.3    24.7    8.4    run step: updater-runtime-retention
   28.5    29.1    0.7    run step: candidate-recovery
   38.4    38.7    0.3    run step: previous gateway verification
   58.9   149.9   91.0    run step: activating
   59.6    59.9    0.3    run step: service-stop
   59.6      systemd: Stopping openclaw-gateway
   59.9    * systemd: Stopped openclaw-gateway
   60.1    60.2    0.1  * run step: post-stop-checks
   60.6    75.6   15.0  * run step: database snapshot
   80.9   139.4   58.5  * run step: openclaw doctor
   85.8   139.3   53.5  * Doctor run 1 (stderr progress, first 'Update schema admission')
  139.4   139.4    0.0  * run step: database migration writes
  139.4   144.9    5.5  * run step: update-driver-handoff
  145.8   149.8    4.0  * run step: post-update verification
  149.9   152.6    2.7  * run step: restarting
  149.9   150.1    0.2  * run step: managed-service-executor-check
  150.1   152.6    2.4  * run step: managed-service-install
  152.5    * systemd: Started openclaw-gateway
  152.6   172.5   19.9  * run step: verifying
  158.7   158.7    0.0  * run step: gateway verification
  264.7      systemd: Stopping openclaw-gateway
  265.0      systemd: Stopped openclaw-gateway

== G-head.2 u1: exit 0 wall 192.1 s
not serving:    53.5 ->   147.0 = 93.6 s
  start     end   secs  what
    2.7    14.1   11.3    run step: requested
   14.1    14.1    0.0    run step: staging
   14.1    52.6   38.5    run step: validating
   14.6    22.8    8.2    run step: updater-runtime-retention
   26.1    26.8    0.7    run step: candidate-recovery
   35.8    36.0    0.3    run step: previous gateway verification
   52.6   136.7   84.1    run step: activating
   53.2    53.5    0.3    run step: service-stop
   53.3      systemd: Stopping openclaw-gateway
   53.5    * systemd: Stopped openclaw-gateway
   53.7    53.8    0.1  * run step: post-stop-checks
   54.1    68.0   13.8  * run step: database snapshot
   73.9   125.8   51.9  * run step: openclaw doctor
   78.6   125.7   47.2  * Doctor run 1 (stderr progress, first 'Update schema admission')
  125.8   125.8    0.0  * run step: database migration writes
  125.8   131.6    5.8  * run step: update-driver-handoff
  132.6   136.6    4.0  * run step: post-update verification
  136.7   139.7    3.0  * run step: restarting
  136.7   136.9    0.2  * run step: managed-service-executor-check
  137.0   139.7    2.7  * run step: managed-service-install
  139.6    * systemd: Started openclaw-gateway
  139.7   156.9   17.1  * run step: verifying
  147.2   147.2    0.0    run step: gateway verification
  242.8      systemd: Stopping openclaw-gateway
  243.2      systemd: Stopped openclaw-gateway

== R-base.1 u1: exit 0 wall 141.1 s
not serving:    38.4 ->    99.2 = 60.7 s
  start     end   secs  what
    2.6    14.2   11.6    run step: requested
   14.2    14.2    0.0    run step: staging
   14.2    37.6   23.4    run step: validating
   14.7    23.3    8.6    run step: updater-runtime-retention
   26.6    27.2    0.6    run step: candidate-recovery
   36.1    36.4    0.3    run step: previous gateway verification
   37.6    88.1   50.5    run step: activating
   38.3    38.5    0.3    run step: service-stop
   38.3      systemd: Stopping openclaw-gateway
   38.5    * systemd: Stopped openclaw-gateway
   38.7    38.8    0.1  * run step: post-stop-checks
   39.2    40.2    1.0  * run step: database snapshot
   45.3    70.2   25.0  * run step: openclaw doctor
   46.5    70.0   23.5  * Doctor run 1 (stderr progress, first 'Update schema admission')
   70.2    70.2    0.0  * run step: database migration writes
   70.2    73.2    3.0  * run step: update-driver-handoff
   74.2    87.9   13.7  * run step: post-update verification
   76.6    83.6    6.9  * Doctor run 2 (stderr progress, first 'Update schema admission')
   83.6    83.6    0.0  * Doctor run 3 (stderr progress, first 'Update schema admission')
   88.1    91.9    3.7  * run step: restarting
   88.1    88.4    0.3  * run step: managed-service-executor-check
   88.4    91.8    3.4  * run step: managed-service-install
   91.7    * systemd: Started openclaw-gateway
   91.9   108.5   16.7  * run step: verifying
   99.3    99.3    0.0    run step: gateway verification
  195.3      systemd: Stopping openclaw-gateway
  195.6      systemd: Stopped openclaw-gateway

== R-head.1 u1: exit 0 wall 126.0 s
not serving:    39.9 ->    89.8 = 49.9 s
  start     end   secs  what
    2.8    15.4   12.5    run step: requested
   15.4    15.4    0.0    run step: staging
   15.4    38.9   23.5    run step: validating
   15.9    24.1    8.2    run step: updater-runtime-retention
   27.7    28.4    0.7    run step: candidate-recovery
   37.3    37.5    0.3    run step: previous gateway verification
   38.9    80.1   41.2    run step: activating
   39.6    39.9    0.3    run step: service-stop
   39.6      systemd: Stopping openclaw-gateway
   39.9    * systemd: Stopped openclaw-gateway
   40.1    40.2    0.1  * run step: post-stop-checks
   40.7    41.8    1.1  * run step: database snapshot
   47.3    71.2   24.0  * run step: openclaw doctor
   48.4    71.1   22.7  * Doctor run 1 (stderr progress, first 'Update schema admission')
   71.2    71.2    0.0  * run step: database migration writes
   71.2    74.2    3.0  * run step: update-driver-handoff
   75.2    80.0    4.8  * run step: post-update verification
   80.1    83.2    3.1  * run step: restarting
   80.1    80.3    0.2  * run step: managed-service-executor-check
   80.3    83.1    2.8  * run step: managed-service-install
   83.0    * systemd: Started openclaw-gateway
   83.2    98.4   15.2  * run step: verifying
   90.0    90.0    0.0    run step: gateway verification
  177.2      systemd: Stopping openclaw-gateway
  177.4      systemd: Stopped openclaw-gateway

== N-base.1 u1: exit 0 wall 155.6 s
not serving:    44.2 ->   112.7 = 68.5 s
  start     end   secs  what
    3.1    16.8   13.7    run step: requested
   16.8    16.8    0.0    run step: staging
   16.8    43.3   26.5    run step: validating
   17.4    27.1    9.6    run step: updater-runtime-retention
   31.1    31.9    0.8    run step: candidate-recovery
   41.3    41.6    0.3    run step: previous gateway verification
   43.3   101.0   57.6    run step: activating
   44.1    44.5    0.4    run step: service-stop
   44.2      systemd: Stopping openclaw-gateway
   44.5    * systemd: Stopped openclaw-gateway
   44.7    44.8    0.1  * run step: post-stop-checks
   45.3    46.5    1.3  * run step: database snapshot
   53.2    79.4   26.1  * run step: openclaw doctor
   54.6    79.1   24.5  * Doctor run 1 (stderr progress, first 'Update schema admission')
   79.4    79.4    0.0  * run step: database migration writes
   79.4    82.7    3.3  * run step: update-driver-handoff
   83.8   100.8   17.0  * run step: post-update verification
   86.4    96.8   10.3  * Doctor run 2 (stderr progress, first 'Update schema admission')
   96.9    96.9    0.0  * Doctor run 3 (stderr progress, first 'Update schema admission')
  101.0   104.4    3.4  * run step: restarting
  101.0   101.2    0.2  * run step: managed-service-executor-check
  101.2   104.3    3.1  * run step: managed-service-install
  104.2    * systemd: Started openclaw-gateway
  104.4   122.6   18.2  * run step: verifying
  112.9   112.9    0.0    run step: gateway verification
  211.6      systemd: Stopping openclaw-gateway
  211.9      systemd: Stopped openclaw-gateway

== N-head.1 u1: exit 0 wall 197.7 s
not serving:    53.7 ->   154.6 = 100.9 s
  start     end   secs  what
    2.8    15.2   12.4    run step: requested
   15.2    15.2    0.0    run step: staging
   15.2    52.0   36.8    run step: validating
   15.8    26.4   10.6    run step: updater-runtime-retention
   31.3    32.2    0.9    run step: candidate-recovery
   48.4    49.0    0.6    run step: previous gateway verification
   52.0   142.9   90.8    run step: activating
   53.6    54.0    0.4    run step: service-stop
   53.6      systemd: Stopping openclaw-gateway
   54.0    * systemd: Stopped openclaw-gateway
   54.5    54.9    0.4  * run step: post-stop-checks
   55.8    58.0    2.2  * run step: database snapshot
   69.5   105.6   36.1  * run step: openclaw doctor
   71.1   105.4   34.3  * Doctor run 1 (stderr progress, first 'Update schema admission')
  105.6   105.6    0.0  * run step: database migration writes
  105.6   109.1    3.5  * run step: update-driver-handoff
  111.0   142.6   31.6  * run step: post-update verification
  116.5   138.2   21.8  * Doctor run 2 (stderr progress, first 'Update schema admission')
  138.4   138.4    0.0  * Doctor run 3 (stderr progress, first 'Update schema admission')
  142.9   147.0    4.1  * run step: restarting
  142.9   143.1    0.2  * run step: managed-service-executor-check
  143.2   146.9    3.7  * run step: managed-service-install
  146.7    * systemd: Started openclaw-gateway
  147.0   164.1   17.2  * run step: verifying
  155.1   155.2    0.0    run step: gateway verification
  253.8      systemd: Stopping openclaw-gateway
  254.1      systemd: Stopped openclaw-gateway

== F-base.1 u1: exit 0 wall 123.7 s
not serving:    38.6 ->    91.0 = 52.4 s
  start     end   secs  what
    2.6    14.1   11.6    run step: requested
   14.1    14.2    0.0    run step: staging
   14.2    37.8   23.7    run step: validating
   14.7    23.4    8.7    run step: updater-runtime-retention
   26.7    27.3    0.6    run step: candidate-recovery
   36.3    36.5    0.3    run step: previous gateway verification
   37.8    82.2   44.4    run step: activating
   38.5    38.7    0.3    run step: service-stop
   38.5      systemd: Stopping openclaw-gateway
   38.7    * systemd: Stopped openclaw-gateway
   38.9    39.0    0.1  * run step: post-stop-checks
   39.4    40.4    1.0  * run step: database snapshot
   45.8    67.3   21.5  * run step: openclaw doctor
   46.9    67.1   20.3  * Doctor run 1 (stderr progress, first 'Update schema admission')
   67.3    67.3    0.0  * run step: database migration writes
   67.3    70.0    2.6  * run step: update-driver-handoff
   70.8    82.0   11.2  * run step: post-update verification
   72.9    78.7    5.8  * Doctor run 2 (stderr progress, first 'Update schema admission')
   78.7    78.7    0.0  * Doctor run 3 (stderr progress, first 'Update schema admission')
   82.2    85.0    2.8  * run step: restarting
   82.2    82.4    0.2  * run step: managed-service-executor-check
   82.5    85.0    2.5  * run step: managed-service-install
   84.9    * systemd: Started openclaw-gateway
   85.0    98.9   13.9  * run step: verifying
   91.2    91.3    0.0    run step: gateway verification
  177.2      systemd: Stopping openclaw-gateway
  177.5      systemd: Stopped openclaw-gateway

== F-head.1 u1: exit 0 wall 152.5 s
not serving:    44.5 ->   118.1 = 73.5 s
  start     end   secs  what
    3.2    16.6   13.4    run step: requested
   16.6    16.7    0.0    run step: staging
   16.7    43.5   26.8    run step: validating
   17.2    27.0    9.7    run step: updater-runtime-retention
   30.9    31.7    0.8    run step: candidate-recovery
   41.5    41.9    0.4    run step: previous gateway verification
   43.5   107.9   64.5    run step: activating
   44.2    44.6    0.4    run step: service-stop
   44.3      systemd: Stopping openclaw-gateway
   44.6    * systemd: Stopped openclaw-gateway
   44.9    45.1    0.2  * run step: post-stop-checks
   45.6    47.2    1.6  * run step: database snapshot
   63.1    90.9   27.9  * run step: openclaw doctor
   64.8    90.7   26.0  * Doctor run 1 (stderr progress, first 'Update schema admission')
   90.9    90.9    0.0  * run step: database migration writes
   90.9    94.1    3.2  * run step: update-driver-handoff
   95.1   107.7   12.6  * run step: post-update verification
   97.5   103.9    6.5  * Doctor run 2 (stderr progress, first 'Update schema admission')
  104.0   104.0    0.0  * Doctor run 3 (stderr progress, first 'Update schema admission')
  107.9   111.3    3.4  * run step: restarting
  107.9   108.2    0.3  * run step: managed-service-executor-check
  108.2   111.3    3.1  * run step: managed-service-install
  111.2    * systemd: Started openclaw-gateway
  111.3   126.4   15.1  * run step: verifying
  118.1   118.1    0.0    run step: gateway verification
  205.4      systemd: Stopping openclaw-gateway
  205.6      systemd: Stopped openclaw-gateway
Raw: Doctor phases from the stamped updater stderr
== E-base.1
Doctor run 1 (22.6 s): Update schema admission 0.6, maintenance begin 0.6, state database repair 0.6, database migrations 4.9, config flow 4.8, contributions 9.2, maintenance ready 0.4, maintenance finish 0.3
Doctor run 2 (5.7 s): Update schema admission 0.3, config flow 0.4, state schema 1.8, contributions 1.6, maintenance ready 0.5
== E-base.2
Doctor run 1 (20.1 s): Update schema admission 0.5, maintenance begin 0.4, state database repair 0.5, database migrations 4.3, config flow 4.2, contributions 8.6, maintenance ready 0.3
Doctor run 2 (5.1 s): config flow 0.3, state schema 1.6, contributions 1.4, maintenance ready 0.4
== E-base.3
Doctor run 1 (20.2 s): Update schema admission 0.4, maintenance begin 0.4, state database repair 0.5, database migrations 4.4, config flow 4.3, contributions 8.5, maintenance ready 0.3
Doctor run 2 (5.0 s): config flow 0.3, state schema 1.6, contributions 1.4, maintenance ready 0.4
== E-head.1
Doctor run 1 (22.6 s): Update schema admission 0.5, maintenance begin 0.5, state database repair 0.5, database migrations 5.0, config flow 4.7, Config repairs 0.8, contributions 9.1, maintenance ready 0.4, maintenance finish 0.3
== E-head.2
Doctor run 1 (23.0 s): Update schema admission 0.6, maintenance begin 0.5, state database repair 0.5, database migrations 5.0, config flow 4.9, Config repairs 0.7, contributions 9.2, maintenance ready 0.4
== E-head.3
Doctor run 1 (20.0 s): Update schema admission 0.4, maintenance begin 0.4, state database repair 0.5, database migrations 4.2, config flow 4.3, Config repairs 0.7, contributions 8.0, maintenance ready 0.4
== G-base.1
Doctor run 1 (53.3 s): Update schema admission 3.7, maintenance begin 3.7, state database repair 0.5, database migrations 20.8, heartbeat migration backups 0.9, config flow 8.1, contributions 10.2, maintenance ready 0.4, maintenance finish 4.0
Doctor run 2 (5.8 s): Update schema admission 0.3, config flow 0.3, state schema 1.8, contributions 1.6, maintenance ready 0.5
== G-base.2
Doctor run 1 (54.1 s): Update schema admission 3.6, maintenance begin 4.0, state database repair 0.6, database migrations 23.6, heartbeat migration backups 0.7, config flow 6.8, contributions 9.4, maintenance ready 0.4, maintenance finish 3.9
Doctor run 2 (5.6 s): Update schema admission 0.3, config flow 0.4, state schema 1.8, contributions 1.5, maintenance ready 0.5
== G-head.1
Doctor run 1 (53.5 s): Update schema admission 3.4, maintenance begin 4.0, state database repair 0.6, database migrations 22.2, heartbeat migration backups 1.0, config flow 7.4, Config repairs 0.8, contributions 9.3, maintenance ready 0.4, maintenance finish 3.5
== G-head.2
Doctor run 1 (47.2 s): Update schema admission 3.7, maintenance begin 3.6, state database repair 0.5, database migrations 18.5, heartbeat migration backups 0.5, config flow 6.6, Config repairs 0.7, contributions 8.0, maintenance ready 0.4, maintenance finish 3.9
== R-base.1
Doctor run 1 (23.5 s): Update schema admission 0.5, maintenance begin 0.5, state database repair 0.5, database migrations 4.8, config flow 4.9, Config repairs 0.9, contributions 9.8, maintenance ready 0.4, maintenance finish 0.3
Doctor run 2 (6.9 s): Update schema admission 0.3, config flow 0.4, state schema 2.3, Config repairs 0.4, contributions 1.9, maintenance ready 0.5
== R-head.1
Doctor run 1 (22.7 s): Update schema admission 0.5, maintenance begin 0.5, state database repair 0.5, database migrations 4.7, config flow 4.8, Config repairs 0.8, contributions 9.2, maintenance ready 0.4, maintenance finish 0.4
== N-base.1
Doctor run 1 (24.5 s): Update schema admission 0.6, maintenance begin 0.5, state database repair 0.6, database migrations 5.1, config flow 5.3, Config repairs 0.8, contributions 9.9, maintenance ready 0.4, maintenance finish 0.4
Doctor run 2 (10.3 s): Update schema admission 0.4, config flow 0.4, state schema 2.0, contributions 5.5, maintenance ready 0.5
== N-head.1
Doctor run 1 (34.3 s): Update schema admission 1.6, retained runtimes 0.4, maintenance begin 0.7, state database repair 1.5, database migrations 7.1, config flow 8.1, Config repairs 1.7, contributions 11.5, maintenance ready 0.4, maintenance finish 0.4
Doctor run 2 (21.8 s): Update schema admission 1.0, retained runtimes 0.5, heartbeat migration backups 0.7, config flow 0.6, state schema 4.5, Config repairs 0.3, contributions 12.4, maintenance ready 0.7
== F-base.1
Doctor run 1 (20.3 s): Update schema admission 0.5, maintenance begin 0.5, state database repair 0.5, database migrations 4.3, config flow 4.3, Config repairs 0.8, contributions 8.0, maintenance ready 0.3
Doctor run 2 (5.8 s): config flow 0.4, state schema 1.6, Config repairs 0.4, contributions 1.8, maintenance ready 0.4
== F-head.1
Doctor run 1 (26.0 s): Update schema admission 0.7, maintenance begin 0.7, state database repair 0.7, database migrations 5.7, config flow 5.5, Config repairs 1.0, contributions 9.9, maintenance ready 0.4, maintenance finish 0.3
Doctor run 2 (6.5 s): Update schema admission 0.3, config flow 0.4, state schema 1.9, Config repairs 0.5, contributions 1.8, maintenance ready 0.5
Raw: state comparison base vs head
== E-base.2 vs E-head.2
config keys ['agents', 'gateway', 'meta', 'wizard'] / ['agents', 'gateway', 'meta', 'wizard'] metaKeys ['lastTouchedVersion', 'migrations'] / ['lastTouchedVersion', 'migrations'] normalized body same
db agents/main/agent/openclaw-agent.sqlite: userVersion 45/45 schemaSha same tables 61/61 rowcount diffs none
db client/credentials.sqlite: userVersion 1/1 schemaSha same tables 5/5 rowcount diffs none
db control/services.sqlite: userVersion 1/1 schemaSha same tables 2/2 rowcount diffs none
db state/openclaw-quarantine.sqlite: userVersion 2/2 schemaSha same tables 2/2 rowcount diffs none
db state/openclaw.sqlite: userVersion 42/42 schemaSha same tables 104/104 rowcount diffs none
turn A: {'injectOk': True, 'historyHasNewMarker': True, 'historyHasSetupMarker': True} B: {'injectOk': True, 'historyHasNewMarker': True, 'historyHasSetupMarker': True}
run A: {'status': 'succeeded', 'from': '2026.11.10', 'to': '2026.11.13', 'retirement': [('finalize:doctor:model-retirement', 'completed'), ('warning:finalize:doctor:model-retirement:deferred', 'skipped'), ('warning:finalize:doctor:model-retirement', 'completed')], 'doctorSteps': ['openclaw doctor', 'post-plugin doctor']}
run B: {'status': 'succeeded', 'from': '2026.11.10', 'to': '2026.11.14', 'retirement': [], 'doctorSteps': ['openclaw doctor']}
== E-base.3 vs E-head.3
config keys ['agents', 'gateway', 'meta', 'wizard'] / ['agents', 'gateway', 'meta', 'wizard'] metaKeys ['lastTouchedVersion', 'migrations'] / ['lastTouchedVersion', 'migrations'] normalized body same
db agents/main/agent/openclaw-agent.sqlite: userVersion 45/45 schemaSha same tables 61/61 rowcount diffs none
db client/credentials.sqlite: userVersion 1/1 schemaSha same tables 5/5 rowcount diffs none
db control/services.sqlite: userVersion 1/1 schemaSha same tables 2/2 rowcount diffs none
db state/openclaw-quarantine.sqlite: userVersion 2/2 schemaSha same tables 2/2 rowcount diffs none
db state/openclaw.sqlite: userVersion 42/42 schemaSha same tables 104/104 rowcount diffs none
turn A: {'injectOk': True, 'historyHasNewMarker': True, 'historyHasSetupMarker': True} B: {'injectOk': True, 'historyHasNewMarker': True, 'historyHasSetupMarker': True}
run A: {'status': 'succeeded', 'from': '2026.11.10', 'to': '2026.11.13', 'retirement': [('finalize:doctor:model-retirement', 'completed'), ('warning:finalize:doctor:model-retirement:deferred', 'skipped'), ('warning:finalize:doctor:model-retirement', 'completed')], 'doctorSteps': ['openclaw doctor', 'post-plugin doctor']}
run B: {'status': 'succeeded', 'from': '2026.11.10', 'to': '2026.11.14', 'retirement': [], 'doctorSteps': ['openclaw doctor']}
== G-base.2 vs G-head.2
config keys ['agents', 'gateway', 'meta', 'wizard'] / ['agents', 'gateway', 'meta', 'wizard'] metaKeys ['lastTouchedVersion', 'migrations'] / ['lastTouchedVersion', 'migrations'] normalized body same
db agents/main/agent/openclaw-agent.sqlite: userVersion 45/45 schemaSha same tables 61/61 rowcount diffs none
db client/credentials.sqlite: userVersion 1/1 schemaSha same tables 5/5 rowcount diffs none
db control/services.sqlite: userVersion 1/1 schemaSha same tables 2/2 rowcount diffs none
db state/openclaw-quarantine.sqlite: userVersion 2/2 schemaSha same tables 2/2 rowcount diffs none
db state/openclaw.sqlite: userVersion 42/42 schemaSha same tables 104/104 rowcount diffs none
turn A: {'injectOk': True, 'historyHasNewMarker': True, 'historyHasSetupMarker': True} B: {'injectOk': True, 'historyHasNewMarker': True, 'historyHasSetupMarker': True}
run A: {'status': 'succeeded', 'from': '2026.11.10', 'to': '2026.11.13', 'retirement': [('finalize:doctor:model-retirement', 'completed'), ('warning:finalize:doctor:model-retirement:deferred', 'skipped'), ('warning:finalize:doctor:model-retirement', 'completed')], 'doctorSteps': ['openclaw doctor', 'post-plugin doctor']}
run B: {'status': 'succeeded', 'from': '2026.11.10', 'to': '2026.11.14', 'retirement': [], 'doctorSteps': ['openclaw doctor']}
== R-base.1 vs R-head.1
config keys ['agents', 'gateway', 'meta', 'plugins', 'wizard'] / ['agents', 'gateway', 'meta', 'plugins', 'wizard'] metaKeys ['lastTouchedVersion', 'migrations'] / ['lastTouchedVersion', 'migrations'] normalized body same
db agents/main/agent/openclaw-agent.sqlite: userVersion 45/45 schemaSha same tables 61/61 rowcount diffs none
db client/credentials.sqlite: userVersion 1/1 schemaSha same tables 5/5 rowcount diffs none
db control/services.sqlite: userVersion 1/1 schemaSha same tables 2/2 rowcount diffs none
db state/openclaw-quarantine.sqlite: userVersion 2/2 schemaSha same tables 2/2 rowcount diffs none
db state/openclaw.sqlite: userVersion 42/42 schemaSha same tables 104/104 rowcount diffs none
turn A: {'injectOk': True, 'historyHasNewMarker': True, 'historyHasSetupMarker': True} B: {'injectOk': True, 'historyHasNewMarker': True, 'historyHasSetupMarker': True}
run A: {'status': 'succeeded', 'from': '2026.11.10', 'to': '2026.11.13', 'retirement': [('finalize:doctor:model-retirement', 'completed'), ('warning:finalize:doctor:model-retirement:deferred', 'skipped'), ('warning:finalize:doctor:model-retirement', 'completed')], 'doctorSteps': ['openclaw doctor', 'post-plugin doctor']}
run B: {'status': 'succeeded', 'from': '2026.11.10', 'to': '2026.11.14', 'retirement': [], 'doctorSteps': ['openclaw doctor']}
== N-base.1 vs N-head.1
config keys ['agents', 'gateway', 'meta', 'wizard'] / ['agents', 'gateway', 'meta', 'wizard'] metaKeys ['lastTouchedVersion', 'migrations'] / ['lastTouchedVersion', 'migrations'] normalized body same
db agents/main/agent/openclaw-agent.sqlite: userVersion 45/45 schemaSha same tables 61/61 rowcount diffs none
db client/credentials.sqlite: userVersion 1/1 schemaSha same tables 5/5 rowcount diffs none
db control/services.sqlite: userVersion 1/1 schemaSha same tables 2/2 rowcount diffs none
db state/openclaw-quarantine.sqlite: userVersion 2/2 schemaSha same tables 2/2 rowcount diffs none
db state/openclaw.sqlite: userVersion 42/42 schemaSha same tables 104/104 rowcount diffs none
turn A: {'injectOk': True, 'historyHasNewMarker': True, 'historyHasSetupMarker': True} B: {'injectOk': True, 'historyHasNewMarker': True, 'historyHasSetupMarker': True}
run A: {'status': 'succeeded', 'from': '2026.11.10', 'to': '2026.11.13', 'retirement': [('finalize:doctor:model-retirement', 'skipped'), ('warning:finalize:doctor:model-retirement:deferred', 'completed')], 'doctorSteps': ['openclaw doctor', 'post-plugin doctor']}
run B: {'status': 'succeeded', 'from': '2026.11.10', 'to': '2026.11.14', 'retirement': [('finalize:doctor:model-retirement', 'skipped'), ('warning:finalize:doctor:model-retirement:deferred', 'completed')], 'doctorSteps': ['openclaw doctor', 'post-plugin doctor']}
== F-base.1 vs F-head.1
config keys ['agents', 'gateway', 'meta', 'plugins', 'wizard'] / ['agents', 'gateway', 'meta', 'plugins', 'wizard'] metaKeys ['lastTouchedVersion', 'migrations'] / ['lastTouchedVersion', 'migrations'] normalized body same
db agents/main/agent/openclaw-agent.sqlite: userVersion 45/45 schemaSha same tables 61/61 rowcount diffs none
db client/credentials.sqlite: userVersion 1/1 schemaSha same tables 5/5 rowcount diffs none
db control/services.sqlite: userVersion 1/1 schemaSha same tables 2/2 rowcount diffs none
db state/openclaw-quarantine.sqlite: userVersion 2/2 schemaSha same tables 2/2 rowcount diffs none
db state/openclaw.sqlite: userVersion 42/42 schemaSha same tables 104/104 rowcount diffs none
turn A: {'injectOk': True, 'historyHasNewMarker': True, 'historyHasSetupMarker': True} B: {'injectOk': True, 'historyHasNewMarker': True, 'historyHasSetupMarker': True}
run A: {'status': 'succeeded', 'from': '2026.11.10', 'to': '2026.11.13', 'retirement': [('finalize:doctor:model-retirement', 'completed'), ('warning:finalize:doctor:model-retirement:deferred', 'skipped'), ('warning:finalize:doctor:model-retirement', 'completed')], 'doctorSteps': ['openclaw doctor', 'post-plugin doctor']}
run B: {'status': 'succeeded', 'from': '2026.11.10', 'to': '2026.11.14', 'retirement': [('finalize:doctor:model-retirement', 'completed'), ('warning:finalize:doctor:model-retirement:deferred', 'skipped'), ('warning:finalize:doctor:model-retirement', 'completed')], 'doctorSteps': ['openclaw doctor', 'post-plugin doctor']}

Tests

  • src/commands/doctor/repair-sequencing.test.ts: new package update doctor pass cases. The "nothing to change" case fails on main and passes here; the four "waits" cases pass on both (they guard against skipping real work). 36/36 pass.
  • src/cli/update-cli/update-command-resume-completion.test.ts: the "retires the settled model warning" case relied on the unconditional deferral. Its config now names a stale primary with an available fallback, so the deferral and its completion still happen and the case keeps testing warning retirement. 11/11 pass.
  • Affected suites, 11 files, 253 tests pass: doctor-config-flow, auth-alias-migration, auth-alias-preservation, doctor-repair-setup, doctor-config-flow.billing-route, doctor-update-run, doctor-health.update, deferred-update-warnings, update-command-resume-completion, update-command-fresh-doctor, repair-sequencing.
  • pnpm tsgo:core passes; session identity ratchet passes; autoreview (Codex, P0 to P2): no findings.

Files audited in full: both touched test files. Nothing was removed; the only edit to an existing case is the config change above.

Windows estimate (not measured on this change). On Windows Server 2025 x64, 2 vCPU, published 2026.11.10 to main recorded the same deferral, unchanged plugins and a retirement-only second Doctor of 46.3 to 52.8 s inside a 322 to 344 s outage. If that install has no plugin install record and nothing to retire (the onboarded test install appears to have neither, not verified), this change removes that run: roughly 45 to 55 s, about 15% of the outage. The first Doctor (107 to 114 s) and the installed updater's runtime retention are unchanged.

Not proven: no Windows or macOS cell on this change; no cell with an externally installed plugin (those keep the second Doctor by design); one to three runs per cell, so totals are within host noise; the Doctor 1 section breakdown for the 4 GiB cell comes from progress line timestamps because the update's Doctor sections diagnostic is truncated (it now leads with pending.* entries).

…g to wait for

During a package update the first Doctor deferred model retirement on every run,
and that recorded deferral made the updater start a second Doctor after plugin
convergence. With no plugin install to converge and no change from the deferred
repairs, the second Doctor had nothing to do but still ran with the Gateway stopped.
@clawsweeper

clawsweeper Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

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

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes commands Command implementations size: S labels Nov 26, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:other This issue has meaningful maintainer-visible impact outside the owned taxonomy. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 26, 2026
@clawsweeper

clawsweeper Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

This PR avoids recording deferred model retirement when the existing repairs have nothing to change or warn about.

Example: Update from v2026.11.10 with no installed plugins and no pending model repairs.

  • Before: The first Doctor records a deferral that triggers another Doctor while the Gateway remains stopped.
  • After: The idle repair preview records no deferral, allowing the updater to skip that second Doctor.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused source change appears sound, but required real-upgrade proof is absent and execution of the regression tests is not established.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A first upgrade from a published release can keep the Gateway stopped for a second Doctor that has no remaining repair work.
Reason: Removing an unnecessary stopped-Gateway invocation has clear user value, and the maintainer-authored direction stays within candidate Doctor's existing responsibility.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored draft open: it addresses unnecessary update downtime still present on main, and source review found no definite introduced bug.

Reviewed head: 9828d4efb95bbaa10477c5442f33ef3ca2ddcc8d

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Supply redacted before-and-after v2026.11.10 upgrade output showing Doctor invocation counts, Gateway readiness and preserved settings, with a pending-repair control; base-red/head-green regression execution is also not shown.
Agent review details

How this fits together

During a shipped updater's first upgrade, candidate Doctor inspects configuration and plugin state; its retirement receipt helps the updater decide whether another Doctor must run before restart.

flowchart TD
  A[Published updater] --> B[Candidate Doctor]
  B --> C[Plugin repair facts]
  C --> D[Preview existing repairs]
  D --> E[Retirement deferral receipt]
  E --> F[Post-plugin Doctor selection]
  F --> G[Gateway restart]
Loading

Technical review

Best possible solution:

Keep the retirement decision in Doctor and skip its second invocation only when existing repair owners establish that no deferred work remains.

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

Current-main source connects unconditional package-swap deferral to the second-Doctor selector, and the linked discussion reports that extra invocation during published-release upgrades; no target code was executed in this read-only review.

Is this the best way to solve the issue?

The patch removes the unnecessary receipt at its producer, reuses existing repair owners, and conservatively retains deferral for install activity, records, warnings, and explicit replacements.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Package-swap retirement deferral changes intended behavior with a stated reason (8b5fa24: Defer retirement until candidate plugin convergence so migration preserves the intended subscription route and completes through the candidate's own receipt.)
  • Stale-plugin cleanup preservation keeps the original intent (80da616: Reuse authoritative plugin metadata while preserving failed installations and version-bound runtime policy during repair sequencing.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 8b5fa24 adds src/commands/doctor/repair-sequencing.ts:366 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8b5fa242a2fa; files: src/commands/doctor/repair-sequencing.ts)

PR surface

Source +68, Tests +86. Total +154 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 79 11 +68
Tests 2 86 0 +86
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 165 11 +154

Preflight source

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

Labels

Label changes:

  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Demonstrate the changed behavior through a published-release upgrade and a pending-repair control.
  • Show the focused regressions failing on the base and passing on the reviewed head.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 26, 2026, 6:41 PM ET / 23:41 UTC.

@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review November 27, 2026 00:26
@fuller-stack-dev
fuller-stack-dev enabled auto-merge (squash) November 27, 2026 00:58
@fuller-stack-dev
fuller-stack-dev merged commit e25b5a5 into openclaw:main Nov 27, 2026
218 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the fix/first-update-skip-idle-retirement-doctor branch November 27, 2026 01:20
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 27, 2026
…tor (openclaw#206227)

* fix(doctor): skip the second update Doctor when retirement has nothing to wait for

During a package update the first Doctor deferred model retirement on every run,
and that recorded deferral made the updater start a second Doctor after plugin
convergence. With no plugin install to converge and no change from the deferred
repairs, the second Doctor had nothing to do but still ran with the Gateway stopped.

* test(update): give the retirement completion case a model reference to retire
tideclaw-bot pushed a commit that referenced this pull request Nov 28, 2026
…tor (#206227)

* fix(doctor): skip the second update Doctor when retirement has nothing to wait for

During a package update the first Doctor deferred model retirement on every run,
and that recorded deferral made the updater start a second Doctor after plugin
convergence. With no plugin install to converge and no change from the deferred
repairs, the second Doctor had nothing to do but still ran with the Gateway stopped.

* test(update): give the retirement completion case a model reference to retire

(cherry picked from commit e25b5a5)
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
…tor (#206227)

* fix(doctor): skip the second update Doctor when retirement has nothing to wait for

During a package update the first Doctor deferred model retirement on every run,
and that recorded deferral made the updater start a second Doctor after plugin
convergence. With no plugin install to converge and no change from the deferred
repairs, the second Doctor had nothing to do but still ran with the Gateway stopped.

* test(update): give the retirement completion case a model reference to retire

(cherry picked from commit e25b5a5)

Companion audit: f9a8f18 is row 25, a separate warning cleanup once durable retirement completes; preserve that row order.

Companion audit: f9a8f18 is independently selected at row 25.

Release adaptation: Preview only the stable stale-plugin and model-reference repair owners; the source-only implicit OpenAI preservation step does not exist on stable.

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations impact:other This issue has meaningful maintainer-visible impact outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant