Skip to content

fix(update): keep updating core when a plugin target is unavailable - #145045

Merged
steipete merged 3 commits into
mainfrom
steipete/upd-plugin-target-advisory
Sep 11, 2026
Merged

steipete merged 3 commits into
mainfrom
steipete/upd-plugin-target-advisory

Conversation

@steipete

@steipete steipete commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #144973
Fixes #145027
Refs #144732

Additional instructions

This is a same-repository branch; maintainers can edit it directly.

What Problem This Solves

Fixes an issue where users running openclaw update could not update core when one configured npm plugin had no resolvable target or its registry was unreachable, even though the installed plugin could continue working.

Why This Change Was Made

Preflight uses the loader's existing openclaw.compat.pluginApi and openclaw.install.minHostVersion contracts. Compatible installed plugins need no registry admission gate. Post-core sync retains their runnable installed version on resolution failures, preserves selectors, and records an advisory in the summary, ledger, and application WARN log, including JSON mode.

If the installed plugin is already incompatible with the target core, a compatible replacement must be resolvable before mutation. Missing targets, returned registry failures, and thrown resolution errors refuse with plugin-incompatible, naming the plugin, installed version, requirement, target core, failure, and retry/pin/disable actions. Final-record checks prevent stale retained-version advisories after later repair.

User Impact

Working plugins can remain installed while core updates finish with status: "ok" and a plugin-target-unavailable advisory. Known incompatibilities cannot proceed on the assumption that an unreachable registry will repair them later. No new configuration, dependencies, manifest fields, or skip switch is introduced.

Release-note context: keep core updates moving when compatible npm plugins have unavailable targets; retain working plugins with actionable warnings and refuse unresolved incompatible replacements before mutation. Thanks to @blaekmajik, @noma-marketplacedb, and @zhangmianzhong-glitch for the reports.

Evidence

  • New outage regressions failed on 6915: four API-range/host-floor cases returned ok instead of the required pre-mutation refusal. After the fix, 245 focused admission, finalization, and plugin-owner tests passed.
  • node scripts/check-changed.mjs, the full build, and canonical package tarball validation passed. Fresh P1 autoreview of this correction returned scoped-clean with no accepted findings. Earlier retention, JSON/ledger/WARN logging, and Doctor tests remain recorded in the worker handoff.
  • Candidate head: 1b2fc9626068577595e3d328ff17a0236c560903; tarball SHA-256: 21e7c99c7960602b49d2172da1dd2ba540d7db94a243e8233b1a80bfcb538b04. Exact-head CI passed after refreshing the merge snapshot to include fix: restore core lint for daemon install tests #145115; details are recorded below.

Older published 2026.9.3/2026.9.4 updaters execute their old preflight before candidate code. They may still need the documented manual bootstrap followed by openclaw update repair; this change does not retroactively replace an already-running updater.

ClawSweeper review

Skipped — Add data-model compatibility proof: No persisted store, schema, config key, or on-disk format changes are introduced. Retained pins and advisories use the existing ledger and install-record shapes. The real compatible-plugin retention and incompatible-plugin refusal upgrade results below cover the changed behavior.

P1 fixed: both metadata-env failures and thrown registry errors now reach the pre-mutation plugin-incompatible refusal when an installed requirement excludes the target. Compatible-plugin admission remains permissive. Regression failure/pass evidence and the fresh P1 review cover both branches.

P2 upgrade results: both real Docker artifact-update cells passed on the candidate above (Linux arm64, Node 24.19.0):

Installed plugin / registry Result and boundary proof
minHostVersion >=2026.9.5, target 2026.9.4; socket resets Exit 1, plugin-incompatible with ECONNRESET and retry/pin/disable guidance. Gateway PID 1338 and manager PID 1331/start identities, HTTP, unit, core/build-info/inventory identities, and plugin record unchanged. No service mutation, activation, restart, publication, swap, or rollback; only private staging preceded refusal.
minHostVersion >=2026.9.3, target 2026.9.4; HTTP 404 Exit 0, status: "ok", ledger succeeded. Plugin 1.0.0 selector/path/resolved identity/integrity retained; one matching application WARN record; real Gateway HTTP confirms activation.

The negative fixture uses the existing compatibility-host override (2026.9.5) for initial plugin installation and the task-owned managed Gateway. The update CLI invocation has no override; admission evaluates target 2026.9.4. This does not claim a published 2026.9.5 binary. Preparation proved that the real manager stop path closes the endpoint. Existing time limits stayed unchanged, and all owned containers were removed.

CI status

Run 34632689117 passed for exact head 1b2fc9626068577595e3d328ff17a0236c560903. Its checked-out merge cd66f822372c438c0f5ec945e7c4667f751e0626 includes #145115. Both check-lint-core-1 and checks-node-compact-small-6 passed without a job rerun. The exact-head watcher reported GREEN; older failed checks were verified as superseded.

The first close/reopen refresh still ran the previous merge snapshot; a second cycle selected the corrected snapshot. Earlier failures are retained below for provenance.

Run 34629690606 finished with 128 passing and 45 skipped checks. Two jobs failed, and the aggregate openclaw/ci-gate failed with them:

  • check-lint-core-1: src/cli/daemon-cli/install.test.ts:1126 exceeds max-lines (1001). CI checked merge e6c6417d of this head into main 160dee82f740a9951be86972ff1577092d22e407. This file is unchanged across this PR head, 6915, and the original branch base (blob be4b3d2503bdd8391e66b4c025b3d75072629c12); the CI merge has different blob d293d2792f0f16ea5dad2c6523807a10bdd23e43.
  • checks-node-compact-small-6: doctor-update.ledger.test.ts failed “waits for an outstanding real child before rejecting without terminal history” with “Doctor child did not settle normally” at doctor-update.executor.test-support.ts:54. Neither test nor its support file exists in this PR head; both come from the newer-main merge. The test exercises delegated Doctor child ownership, without the plugin preflight.

These unrelated failures are recorded without changing their files, limits, assertions, or timeouts. The scoped local checks, requested P1 autoreview, and both candidate Docker cells passed.

Retain compatible installed npm plugins on unavailable targets or registry errors, with update summary and ledger advisories. Refuse known installed compatibility conflicts before mutation. Preserve target selector intent and explain manual bootstrap for older updaters.
@clawsweeper

clawsweeper Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

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

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes commands Command implementations size: L maintainer Maintainer-authored PR labels Sep 11, 2026
@steipete
steipete marked this pull request as ready for review September 11, 2026 15:49
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. labels Sep 11, 2026
@clawsweeper

clawsweeper Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 11, 2026, 2:45 PM ET / 18:45 UTC (Revision 9).

ClawSweeper review

What this changes

Allows core updates to retain compatible installed npm plugins when replacement targets are unavailable, records actionable warnings, and refuses unresolved incompatible replacements before mutation.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains a useful fix: current main and v2026.9.4 still refuse unavailable plugin targets. No blocking defect was found. The supplied upgrade results address the previous compatibility-proof concern; the diff introduces no stored-format migration.

Priority: P1
Reviewed head: 1b2fc9626068577595e3d328ff17a0236c560903

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with convincing upgrade observations and meaningful regression coverage; no additional correctness or proof blocker remains.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The captured body records real artifact-update runs on the reviewed head: incompatible-plugin socket resets refused before service or installation mutation, while compatible-plugin HTTP 404 retained the installation and selector, emitted a WARN record, completed the ledger, and activated a responding Gateway.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured body records real artifact-update runs on the reviewed head: incompatible-plugin socket resets refused before service or installation mutation, while compatible-plugin HTTP 404 retained the installation and selector, emitted a WARN record, completed the ledger, and activated a responding Gateway.
Evidence reviewed 9 items Current main still needs the fix: The fetched main implementation collects npm resolution failures and throws plugin-target-unavailable without checking whether the installed plugin remains compatible.
Latest release retains the old refusal: Reading the file from v2026.9.4 through GitHub confirms the unconditional unavailable-target refusal also exists in the latest supplied release.
Admission handles both returned and thrown registry failures: The proposed preflight uses existing compatibility checks, skips registry admission for compatible installed packages, and routes returned metadata failures and thrown errors to plugin-incompatible when an installed requirement excludes the target.
Findings None None.
Security None None.

How this fits together

The updater checks configured plugins before replacing OpenClaw, then reconciles their installed packages before restarting the Gateway. Plugin manifests, recorded selectors, and registry results determine whether it proceeds, retains a working plugin, or refuses the update.

flowchart TD
  A[Requested core update] --> B[Installed plugin requirements]
  B --> C{Compatible with target core?}
  C -->|Yes| E[Core update and plugin sync]
  C -->|No| D{Compatible replacement available?}
  D -->|Yes| E
  D -->|No| F[Refuse before mutation]
  E --> G[Retain working plugin or install replacement]
  G --> H[Report outcome and restart Gateway]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +101, Tests +175, Docs +20. Total +296 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 7 205 104 +101
Tests 4 339 164 +175
Docs 1 23 3 +20
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 12 567 271 +296

Review metrics

Metric Value Why it matters
Production and regression coverage Production net +101 lines; tests net +175 lines Production growth implements compatibility-aware retention and visible diagnostics; regression coverage protects refusal ordering, preserved records, and warning propagation.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/cli/update-cli/update-finalization-lifecycle.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep compatibility decisions with the existing plugin contracts, preserve working installations and selector intent during outages, and expose recovery guidance through the existing update results.

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

Yes, from source: current main refuses any configured npm target resolution failure, including when the installed plugin remains compatible. This read-only review did not execute a current-main reproduction.

Is this the best way to solve the issue?

Yes. The patch reuses existing compatibility and payload checks, preserves recorded selectors, and makes recoverable failures visible; the supplied real upgrade results cover retention and pre-mutation refusal.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: Recent reports on released versions show core updates blocked by unavailable plugin targets despite potentially usable installed plugins.
  • 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. Sufficient (live_output): The captured body records real artifact-update runs on the reviewed head: incompatible-plugin socket resets refused before service or installation mutation, while compatible-plugin HTTP 404 retained the installation and selector, emitted a WARN record, completed the ledger, and activated a responding Gateway.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body records real artifact-update runs on the reviewed head: incompatible-plugin socket resets refused before service or installation mutation, while compatible-plugin HTTP 404 retained the installation and selector, emitted a WARN record, completed the ledger, and activated a responding Gateway.

Evidence

What I checked:

  • Current main still needs the fix: The fetched main implementation collects npm resolution failures and throws plugin-target-unavailable without checking whether the installed plugin remains compatible. (src/cli/update-cli/update-command-plugin-preflight.ts:18, b3ffe8760d73)
  • Latest release retains the old refusal: Reading the file from v2026.9.4 through GitHub confirms the unconditional unavailable-target refusal also exists in the latest supplied release. (src/cli/update-cli/update-command-plugin-preflight.ts:63, 3a9d69db306c)
  • Admission handles both returned and thrown registry failures: The proposed preflight uses existing compatibility checks, skips registry admission for compatible installed packages, and routes returned metadata failures and thrown errors to plugin-incompatible when an installed requirement excludes the target. (src/cli/update-cli/update-command-plugin-preflight.ts:59, 1b2fc9626068)
  • Retention preserves existing records and safeguards: The failure path checks compatibility and runnable extension payloads before returning an unchanged outcome. Artifact integrity and capability-consent handling remain in the existing installation path; retention does not install a replacement or rewrite selectors. (src/plugins/update-installed.ts:353, 1b2fc9626068)
  • Previous migration-proof blocker resolved: The reviewed changes reuse existing warning objects, install records, and ledger operations. The final convergence records suppress stale retention advisories after repair. No schema, serialized record shape, configuration key, or migration is introduced, so the previous generic data-model proof request does not apply. (src/cli/update-cli/update-command-plugins.ts:324, 1b2fc9626068)
  • Real upgrade behavior on the reviewed head: The supplied PR-body snapshot, context sourceRevision 00e98e1c319cc7749cbf98d258904c33dacd567b47c22e9f3fc2af6ae37f7f77, records two Docker artifact-update runs on Linux arm64 and Node 24.19.0 using this head and tarball SHA-256 21e7c99c7960602b49d2172da1dd2ba540d7db94a243e8233b1a80bfcb538b04. An incompatible plugin plus socket resets produced exit 1 before service or installation mutation; a compatible plugin plus HTTP 404 produced exit 0, succeeded history, preserved plugin identity and selector, one WARN record, and responding Gateway HTTP. These observations exercise the changed admission and retention owners, rather than merely startup or help output. (1b2fc9626068)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (8 earlier review cycles)
  • reviewed 2026-09-11T15:57:03.605Z sha 8dc7fbb :: blocked before merge. :: none
  • reviewed 2026-09-11T16:33:24.850Z sha 6915a65 :: blocked before merge. :: none
  • reviewed 2026-09-11T16:53:44.823Z sha 6915a65 :: blocked before merge. :: none
  • reviewed 2026-09-11T17:56:19.874Z sha 1b2fc96 :: blocked before merge. :: none
  • reviewed 2026-09-11T18:02:55.656Z sha 1b2fc96 :: blocked before merge. :: none
  • reviewed 2026-09-11T18:11:12.230Z sha 1b2fc96 :: blocked before merge. :: none
  • reviewed 2026-09-11T18:18:07.109Z sha 1b2fc96 :: blocked before merge. :: none
  • reviewed 2026-09-11T18:26:27.688Z sha 1b2fc96 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 11, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Sep 11, 2026
@steipete steipete closed this Sep 11, 2026
@steipete steipete reopened this Sep 11, 2026
@steipete steipete closed this Sep 11, 2026
@steipete steipete reopened this Sep 11, 2026
@steipete
steipete merged commit 59be266 into main Sep 11, 2026
520 of 542 checks passed
@steipete
steipete deleted the steipete/upd-plugin-target-advisory branch September 11, 2026 18:47
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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 docs Improvements or additions to documentation maintainer Maintainer-authored PR 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: L 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.

Update failure: plugin-target-unavailable (2026.9.4) Update failure: plugin-target-unavailable (2026.9.3)

1 participant