fix(plugins): pass syncOfficialPluginInstalls when update --all is used (fixes #94083)#94225
Conversation
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: this PR carries the same central fix as a stronger open sibling, but omits the update-channel context that the updater contract and core update path use for beta-channel plugin resolution. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Use #94084 as the canonical landing path because it preserves channel-aware bulk official sync and has stronger real behavior proof. So I’m closing this here and keeping the remaining discussion on #94084. Review detailsBest possible solution: Use #94084 as the canonical landing path because it preserves channel-aware bulk official sync and has stronger real behavior proof. Do we have a high-confidence way to reproduce the issue? Yes. Current main reaches Is this the best way to solve the issue? No. Passing only official sync is too narrow because the updater contract and core update sibling show official sync must carry update-channel context for beta-channel installs. Security review: Security review cleared: The diff only changes an existing CLI updater call and focused tests; it adds no dependency, workflow, package metadata, secret handling, or new code-execution surface. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 2e44610ba237. |
|
Cluster update: the landing path has moved from #94084 to the clean maintainer copy #96831. #94225 remains correctly closed as the narrower duplicate. #96831 carries the channel-aware implementation from #94084, preserves @ooiuuii's authorship on the commit, and applies the small patch directly on current |
Summary
openclaw plugins update --allleaves trusted official plugins (codex, brave, discord, whatsapp) pinned to exact beta versions after a stable core upgrade, whileopenclaw updatecorrectly syncs them to the stable catalog.runPluginUpdateCommand()insrc/cli/plugins-update-command.tscallsupdateNpmInstalledPlugins()without passingsyncOfficialPluginInstalls, while the coreupdate-command.tspassessyncOfficialPluginInstalls: true. The bulk--allpath never converges official plugin specs to the current catalog.syncOfficialPluginInstalls: params.opts.all ? true : undefinedtoupdateNpmInstalledPlugins()when--allis used. Targeted plugin updates (single plugin, no--all) remain unchanged.src/cli/plugins-update-command.ts— addsyncOfficialPluginInstalls: params.opts.all ? true : undefinedtoupdateNpmInstalledPlugins()callsrc/cli/plugins-cli.update.test.ts— add test verifyingsyncOfficialPluginInstalls: trueis passed for--allplugins update <id>behavior — still does not sync official catalog (operator-authored specs are preserved)openclaw updateflow — already works correctlyRoot Cause
The
updateNpmInstalledPlugins()function insrc/plugins/update.tsaccepts an optionalsyncOfficialPluginInstallsparameter (line 1236). When set, it resolves the trusted official catalog entry and uses it as the target spec for the update, converging beta-pinned installs to stable releases.The core update command (
src/cli/update-cli/update-command.ts) passessyncOfficialPluginInstalls: truein several call sites (lines 1839, 1866, 1886, 1906), soopenclaw updatecorrectly converges official plugins.However,
runPluginUpdateCommand()insrc/cli/plugins-update-command.ts(line 258-279) callsupdateNpmInstalledPlugins()withoutsyncOfficialPluginInstalls, regardless of whether--allis set. As a result, the bulk update path treats exact beta official specs as the requested target, leaving them unchanged while the gateway reports version drift.Real behavior proof
Behavior or issue addressed (#94083):
plugins update --allleaves trusted official plugin installs pinned to exact beta specs after a stable core upgrade; fix passessyncOfficialPluginInstalls: trueto converge them to the current official catalog during bulk maintenance.Real environment tested: Linux, Node 22 — Vitest against
runPluginUpdateCommand/updateNpmInstalledPluginsExact steps or command run after this patch:
node scripts/run-vitest.mjs src/cli/plugins-cli.update.test.tsEvidence before fix:
Evidence after fix:
Observed result after fix:
updateNpmInstalledPluginsreceivessyncOfficialPluginInstalls: truewhenplugins update --allis invoked, causing trusted official npm plugin installs to converge to the current official catalog entry. Targetedplugins update <id>continues to not sync official catalog specs (preserving operator-authored spec overrides).What was not tested: Live end-to-end
plugins update --allagainst real npm registry with actual beta→stable version drift; Windows platform upgrade path from2026.6.8-beta.1to2026.6.8; ClawHub-sourced official plugin convergence (only npm path validated).Repro confirmation: New test case on origin/main before the patch fails with
AssertionError: expected false to be true(syncOfficialPluginInstalls is false/undefined for --all). After the patch, all 28 test cases succeed including the new test verifyingsyncOfficialPluginInstalls: trueis passed.Regression Test Plan
src/cli/plugins-cli.update.test.tssyncOfficialPluginInstalls: truepassed toupdateNpmInstalledPluginsnode scripts/run-vitest.mjs src/cli/plugins-cli.update.test.tsReview Findings Addressed
None yet — initial PR submission.
Merge Risk
params.opts.all ? true : undefined--allcode path; targeted single-plugin updates are unaffectedsyncOfficialPluginInstallsremains undefined for single-plugin updates; new test verifies it istruefor--allsyncOfficialPluginInstallsline