Skip to content

fix(plugins): pass syncOfficialPluginInstalls when update --all is used (fixes #94083)#94225

Closed
zenglingbiao wants to merge 1 commit into
openclaw:mainfrom
zenglingbiao:fix/issue-94083-sync-official-plugin-installs
Closed

fix(plugins): pass syncOfficialPluginInstalls when update --all is used (fixes #94083)#94225
zenglingbiao wants to merge 1 commit into
openclaw:mainfrom
zenglingbiao:fix/issue-94083-sync-official-plugin-installs

Conversation

@zenglingbiao

Copy link
Copy Markdown
Contributor

Summary

  • Problem: openclaw plugins update --all leaves trusted official plugins (codex, brave, discord, whatsapp) pinned to exact beta versions after a stable core upgrade, while openclaw update correctly syncs them to the stable catalog.
  • Root Cause: runPluginUpdateCommand() in src/cli/plugins-update-command.ts calls updateNpmInstalledPlugins() without passing syncOfficialPluginInstalls, while the core update-command.ts passes syncOfficialPluginInstalls: true. The bulk --all path never converges official plugin specs to the current catalog.
  • Fix: Pass syncOfficialPluginInstalls: params.opts.all ? true : undefined to updateNpmInstalledPlugins() when --all is used. Targeted plugin updates (single plugin, no --all) remain unchanged.
  • What changed:
    • src/cli/plugins-update-command.ts — add syncOfficialPluginInstalls: params.opts.all ? true : undefined to updateNpmInstalledPlugins() call
    • src/cli/plugins-cli.update.test.ts — add test verifying syncOfficialPluginInstalls: true is passed for --all
  • What did NOT change (scope boundary):
    • Targeted plugins update <id> behavior — still does not sync official catalog (operator-authored specs are preserved)
    • Core openclaw update flow — already works correctly
    • Plugin APIs, activation, gateway loading, npm resolution policy
    • ClawHub/marketplace/git install sources
    • Hook pack update behavior

Root Cause

The updateNpmInstalledPlugins() function in src/plugins/update.ts accepts an optional syncOfficialPluginInstalls parameter (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) passes syncOfficialPluginInstalls: true in several call sites (lines 1839, 1866, 1886, 1906), so openclaw update correctly converges official plugins.

However, runPluginUpdateCommand() in src/cli/plugins-update-command.ts (line 258-279) calls updateNpmInstalledPlugins() without syncOfficialPluginInstalls, regardless of whether --all is 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 --all leaves trusted official plugin installs pinned to exact beta specs after a stable core upgrade; fix passes syncOfficialPluginInstalls: true to converge them to the current official catalog during bulk maintenance.

Real environment tested: Linux, Node 22 — Vitest against runPluginUpdateCommand / updateNpmInstalledPlugins

Exact steps or command run after this patch: node scripts/run-vitest.mjs src/cli/plugins-cli.update.test.ts

Evidence before fix:

$ node scripts/run-vitest.mjs src/cli/plugins-cli.update.test.ts

 RUN  v4.1.8 /home/0668001395/openclawProject1

 ❯ |cli| src/cli/plugins-cli.update.test.ts (28 tests | 1 failed) 789ms
     × syncs official catalog specs when --all is used 4ms

⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯

 FAIL  |cli| src/cli/plugins-cli.update.test.ts > plugins cli update > syncs official catalog specs when --all is used
AssertionError: expected false to be true
 ❯ src/cli/plugins-cli.update.test.ts:1004:53

 Test Files  1 failed (1)
      Tests  1 failed | 27 passed (28)

[test] failed 1 Vitest shard

Evidence after fix:

$ node scripts/run-vitest.mjs src/cli/plugins-cli.update.test.ts

 RUN  v4.1.8 /home/0668001395/openclawProject1

 Test Files  1 passed (1)
      Tests  28 passed (28)
   Start at  00:18:04
   Duration  1.43s

[test] passed 1 Vitest shard

Observed result after fix: updateNpmInstalledPlugins receives syncOfficialPluginInstalls: true when plugins update --all is invoked, causing trusted official npm plugin installs to converge to the current official catalog entry. Targeted plugins update <id> continues to not sync official catalog specs (preserving operator-authored spec overrides).

What was not tested: Live end-to-end plugins update --all against real npm registry with actual beta→stable version drift; Windows platform upgrade path from 2026.6.8-beta.1 to 2026.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 verifying syncOfficialPluginInstalls: true is passed.

Regression Test Plan

  • Target test file: src/cli/plugins-cli.update.test.ts
  • New test case: "syncs official catalog specs when --all is used" — verifies syncOfficialPluginInstalls: true passed to updateNpmInstalledPlugins
  • Existing test: "does not sync official catalog specs for manual plugin updates" — unchanged, must still pass (single-plugin update still omits the flag)
  • Run: node scripts/run-vitest.mjs src/cli/plugins-cli.update.test.ts

Review Findings Addressed

None yet — initial PR submission.

Merge Risk

  • Risk: Low — one-line parameter addition in a single production file, guarded by params.opts.all ? true : undefined
  • Affected code path: Only the bulk --all code path; targeted single-plugin updates are unaffected
  • Test coverage: Existing targeted-update test verifies that syncOfficialPluginInstalls remains undefined for single-plugin updates; new test verifies it is true for --all
  • Rollback: Trivial — remove the added syncOfficialPluginInstalls line

@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. cli CLI command changes size: XS labels Jun 17, 2026
@zenglingbiao

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 17, 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 repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@zenglingbiao

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

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
Relationship: superseded
Canonical: #94084
Summary: The open sibling PR is the canonical candidate for the same linked issue because it includes this PR's central change plus channel-context handling and stronger proof.

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 details

Best 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 updateNpmInstalledPlugins from plugins update --all without official-sync or channel context, and the linked issue describes the stale exact official beta record outcome.

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:

  • vincentkoc: Current-main blame for the touched CLI updater call, the channel-aware updater contract, and the core update sibling path points to recent plugin/update refactor work by Vincent Koc. (role: recent area contributor; confidence: high; commits: 4651ffad4a3e, 844f405ac1be; files: src/cli/plugins-update-command.ts, src/plugins/update.ts, src/cli/update-cli/update-command.ts)
  • steipete: History shows Peter Steinberger extracted the plugin install/update command surface and introduced earlier plugin update tracking documentation that this path builds on. (role: feature-history and adjacent CLI/plugin owner; confidence: high; commits: 5920ea838d51, 54ec14262b84; files: src/cli/plugins-update-command.ts, src/cli/plugins-cli.update.test.ts, docs/cli/plugins.md)
  • huntharo: History shows Harold Hunt added versioned plugin update behavior and tests around recorded specs, which is adjacent to the exact-pin behavior this fix must preserve for targeted updates. (role: introduced versioned update behavior; confidence: medium; commits: 401ffb59f538; files: src/plugins/update.ts, src/plugins/update.test.ts, docs/cli/plugins.md)

Codex review notes: model internal, reasoning high; reviewed against 2e44610ba237.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 18, 2026
@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. labels Jun 18, 2026
@zenglingbiao
zenglingbiao deleted the fix/issue-94083-sync-official-plugin-installs branch June 22, 2026 03:42
@velvet-shark

Copy link
Copy Markdown
Member

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 main for landing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants