Repository navigation
fix(update): keep updating core when a plugin target is unavailable - #145045
Conversation
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.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 11, 2026, 2:45 PM ET / 18:45 UTC (Revision 9). ClawSweeper reviewWhat this changesAllows 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 Review scores
Verification
How this fits togetherThe 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]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +101, Tests +175, Docs +20. Total +296 across 12 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
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 updatecould 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.pluginApiandopenclaw.install.minHostVersioncontracts. 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 aplugin-target-unavailableadvisory. 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
okinstead 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 returnedscoped-cleanwith no accepted findings. Earlier retention, JSON/ledger/WARN logging, and Doctor tests remain recorded in the worker handoff.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-envfailures and thrown registry errors now reach the pre-mutationplugin-incompatiblerefusal 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):
minHostVersion >=2026.9.5, target2026.9.4; socket resetsplugin-incompatiblewithECONNRESETand 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, target2026.9.4; HTTP 404status: "ok", ledgersucceeded. 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 target2026.9.4. This does not claim a published2026.9.5binary. 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 mergecd66f822372c438c0f5ec945e7c4667f751e0626includes #145115. Bothcheck-lint-core-1andchecks-node-compact-small-6passed without a job rerun. The exact-head watcher reportedGREEN; 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-gatefailed with them:src/cli/daemon-cli/install.test.ts:1126exceeds max-lines (1001). CI checked mergee6c6417dof this head into main160dee82f740a9951be86972ff1577092d22e407. This file is unchanged across this PR head, 6915, and the original branch base (blobbe4b3d2503bdd8391e66b4c025b3d75072629c12); the CI merge has different blobd293d2792f0f16ea5dad2c6523807a10bdd23e43.doctor-update.ledger.test.tsfailed “waits for an outstanding real child before rejecting without terminal history” with “Doctor child did not settle normally” atdoctor-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.