#12849: fix(plugins): fallback bundled channel specs when npm install returns 404
cli
maintainer
size: M
This change adds a bundled-plugin fallback for known bundled npm specs so installation can still succeed without a published npm tarball. `openclaw plugins install @openclaw/feishu` currently fails with npm `E404` even though Feishu can be provided by bundled extensions.
- Fixes #8576
- Fixes #13913
- Fixes #12849
- Fixes #15622
- Fixes #13448
lobster-biscuit
Changes:
- add `src/plugins/bundled-sources.ts` to resolve bundled plugin sources and lookup by npm spec
- add `src/plugins/bundled-sources.test.ts` coverage for bundled source resolution and npm spec matching
- reuse the shared bundled source resolver from `src/plugins/update.ts`
- add npm-404 fallback in `src/cli/plugins-cli.ts` to enable/link bundled plugin paths and persist install records
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adds a fallback path for `openclaw plugins install <npm-spec>` when `npm pack` fails with an E404/not-found error: it looks up a matching bundled plugin source by npm spec, adds the bundled plugin’s local path to `plugins.load.paths`, enables the plugin entry, and records an install record so the install persists.
It also extracts the bundled-plugin discovery logic into a new shared module (`src/plugins/bundled-sources.ts`) and updates `src/plugins/update.ts` to reuse it, with accompanying Vitest coverage for bundled source resolution and npm-spec matching.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- Reviewed the changed CLI install flow, new bundled-source resolver, tests, and the refactor in update.ts. The fallback is gated on the existing `npm pack failed:` error string and common 404 markers, and config/installs updates follow existing patterns without introducing obvious correctness or safety regressions.
- No files require special attention
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#21039: Fix npm-spec plugin installs when npm pack output is empty
by graysurf · 2026-02-19
79.4%
#2556: fix(plugin-install): handle existing plugins and filter workspace deps
by longmaba · 2026-01-27
79.1%
#18966: fix(config): downgrade unknown bundled plugin references to warnings
by moxunjinmu · 2026-02-17
79.1%
#9196: Fix: Use local plugins for unpublished npm packages
by vishaltandale00 · 2026-02-05
79.0%
#7090: fix: plugin install uses manifest ID for folder name (#2796)
by dial481 · 2026-02-02
78.6%
#20424: Fix plugin extension path traversal in discovery/install
by markmusson · 2026-02-18
78.5%
#21660: fix(plugins): require explicit allowlist for non-bundled plugins
by AI-Reviewer-QS · 2026-02-20
78.2%
#9796: fix(cli): correct fallback path for bundled Chrome extension (#9772)
by lailoo · 2026-02-05
76.6%
#20402: Pr/load openclaw plugins async
by ramarnat · 2026-02-18
76.2%
#20499: test(plugins): add bundled+config duplicate discovery regression
by dcol91863 · 2026-02-19
75.6%