Skip to content

fix: let published updates finish after Doctor reads model catalogs - #206877

Merged
daniel-lxs merged 2 commits into
mainfrom
openclaw/update-doctor-worker-owners-89ef0a
Nov 27, 2026
Merged

daniel-lxs merged 2 commits into
mainfrom
openclaw/update-doctor-worker-owners-89ef0a

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #206861

What Problem This Solves

An update could roll back after Doctor printed “Doctor complete.” With the Gateway stopped, openclaw sessions --json could return the saved session and exit 0, yet print a cleanup failure on stderr. Both paths left the same model catalog reader running.

User Impact

Published updaters finish installing the new build. Offline session listings no longer print a false cleanup failure after reading a saved session’s model catalog. Neither fix requires a configuration change. Genuine Doctor failures still trigger rollback.

Why This Change Was Made

One-shot worker sharing in #206721 exposed a missing cleanup owner. The catalog pool registered its close callback only when an update generation owned it. Without a generation, its reader kept the shared worker alive. The pool now registers the same callback with the default native worker source. Both the regular CLI and the published updater’s delegated Doctor drain that source. Worker sharing and the live-worker check stay intact.

Evidence

I ran published-driver-update-docker.sh against real npm installs on AWS CrabBox Linux. Each driver used the same packaged PR head.

Published driver Baseline a14e58f056a0 PR head f4d789f8e6a9
2026.9.37 Doctor 1; database and package rolled back Doctor 0; update succeeded
2026.10.34 Doctor 1; database and package rolled back Doctor 0; update succeeded
2026.11.10 Not run on baseline Doctor 0; update succeeded, scoped restore passed

All three Gateways returned /readyz 200 and reported build ID 2026.11.10-f4d789f8e6a9-2026-11-27T18-31-02.273Z. Durable history survived restart; incognito history did not.

Offline sessions red/green: I created a saved session through a real Gateway, stopped it, verified its listener was down and configured a model. openclaw sessions --json returned the saved row and exited 0 on every run. Cleanup warnings: 2026.11.10 0/3, main 1decc861 3/3, PR head f4d789f8 0/3. On main, the only remaining endpoint was plugin-model-catalog-read with no stop requested. On the PR head none remained. Without a configured model, none of the three builds warned.

The focused worker regression failed on the baseline and passed on this head. The catalog and CLI cleanup suites, formatting, targeted lint and core typecheck passed. I confirmed main CI failed at the published update step. The hosted PR update lane was skipped, not counted as green; I did not run its PostgreSQL or native systemd cells.

Reported and co-authored by @daniel-lxs.

Work sessions

Linked for team reference; these sessions aren’t public.

Worked on by

🦞 Made with OpenClaw

roboclaw-bot and others added 2 commits November 27, 2026 18:08
Retain the catalog read pool on the default native worker source when no update generation owns it. Executable CLI cleanup and delegated update Doctor both drain that source before checking for live workers.

Co-authored-by: daniel-lxs <[email protected]>
Worked on by:
- @daniel-lxs

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: b8848d5d-940c-4700-a8a5-6d42aea9dc49
@clawsweeper

clawsweeper Bot commented Nov 27, 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 agents Agent runtime and tooling size: XS labels Nov 27, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. impact:crash-loop Crash, hang, restart loop, or process-level availability failure. clawsweeper:intake:bug Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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. labels Nov 27, 2026
@clawsweeper

clawsweeper Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

Register unbound model catalog reader pools with the existing native-worker shutdown owner.

Example: A published 2026.10.34 updater installs the candidate and Doctor reads an agent’s model catalog.

  • Before: Doctor exits 1 because native execution owners remain, triggering rollback.
  • After: The catalog pool closes before native shutdown, Doctor exits 0, and the update succeeds.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A small, coherent lifecycle repair with reported shipped-entry-point red/green and upgrade evidence; broad current-head CI remains incomplete.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The body records real npm-driver upgrades to packaged head f4d789f on Linux, successful delegated Doctor completion and Gateway readiness, latest-stable upgrade with retained durable history, and offline-session warning elimination; linked artifacts were inaccessible from this environment.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Updates can roll back after Doctor completes, and offline session listings can print a false cleanup failure.
Reason: The maintainer-authored PR restores orderly executable shutdown with a narrow change to the existing resource owner.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

This PR provides a focused fix for a current cleanup defect; no introduced correctness or security findings remain, and current-head CI is still pending.

Reviewed head: f4d789f8e6a915ed81bf82f92c0915fbdd24b54d

Before merge

None.

Findings

None.

Agent review details

How this fits together

Doctor and offline session listings read persisted model catalogs through a worker pool; executable cleanup must close that pool before joining its shared native host.

flowchart TD
  A[Doctor or sessions CLI] --> B[Catalog read pool]
  B --> C[Shared worker host]
  D[CLI cleanup] --> E[Native shutdown owner]
  E --> B
  E --> C
Loading

Technical review

Best possible solution:

Keep catalog-pool settlement under the existing generation or default native lifecycle owner, preserving shared hosting and the live-worker guard.

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

Current-main source establishes the missing unbound pool drain and matching native-shutdown error, supported by reported published-updater and offline-session reproductions; this review executed no target code.

Is this the best way to solve the issue?

The change repairs resource ownership at the catalog-pool producer using an existing lifecycle callback, without weakening shutdown checks or adding a parallel cleanup path.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Catalog reader pool lifetime keeps the original intent (9c12710: Retain physical admission facts across asynchronous catalog reads through an owned read-only worker while preserving catalog results and refusal behavior.)
  • Executable cleanup regression test keeps the original intent (685fdc1: Drain shared-state and native workers after command disposal so successful Doctor completion does not end in an updater-rejected process failure.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +5, Tests +11. Total +16 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 6 1 +5
Tests 1 11 0 +11
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 17 1 +16

Preflight source

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

Labels

Label changes:

No label changes.

Label justifications:

  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-27T18:37:04.255Z sha f4d789f :: passed. :: none

Reviewed November 27, 2026, 2:06 PM ET / 19:06 UTC (Revision 2).

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 27, 2026 19:02
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@daniel-lxs
daniel-lxs merged commit a8a503e into main Nov 27, 2026
217 of 218 checks passed
@daniel-lxs
daniel-lxs deleted the openclaw/update-doctor-worker-owners-89ef0a branch November 27, 2026 20:37
tideclaw-bot pushed a commit that referenced this pull request Nov 28, 2026
…206877)

Retain the catalog read pool on the default native worker source when no update generation owns it. Executable CLI cleanup and delegated update Doctor both drain that source before checking for live workers.

Co-authored-by: daniel-lxs <[email protected]>
Co-authored-by: daniel-lxs <[email protected]>
(cherry picked from commit a8a503e)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 28, 2026
…penclaw#206877)

Retain the catalog read pool on the default native worker source when no update generation owns it. Executable CLI cleanup and delegated update Doctor both drain that source before checking for live workers.

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

Labels

agents Agent runtime and tooling cli CLI command changes impact:crash-loop Crash, hang, restart loop, or process-level availability failure. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

Published updates roll back after Doctor finishes reading an agent’s model catalog

2 participants