#18966: fix(config): downgrade unknown bundled plugin references to warnings
size: S
Cluster:
Plugin Management Enhancements
## Problem
When a bundled plugin's directory is missing or unresolvable (e.g. after upgrading from an external plugin to a stock/bundled one), config validation treats the plugin reference as a hard error and blocks startup. This affects users who have `plugins.entries`, `plugins.allow`, or `channels` referencing a plugin like `feishu` that was previously external but is now bundled — if the `extensions/` directory is incomplete, the application refuses to start.
## Solution
Downgrade "plugin not found" and "unknown channel id" errors to warnings when the referenced ID is clearly associated with a configured channel plugin:
- **Channel validation**: when an unknown channel key is also referenced in `plugins.entries` or `plugins.allow`, emit a warning instead of a hard error
- **Plugin entries/allow/deny validation**: when an unknown plugin ID matches a channel key in `config.channels` or a channel declared by a discovered plugin, emit a warning instead of a hard error
The warning message includes guidance that the entry can be removed.
## Test Plan
- Added test case that simulates a missing bundled plugins directory (`OPENCLAW_BUNDLED_PLUGINS_DIR` pointed to an empty dir)
- Verifies `feishu` referenced in `plugins.entries`, `plugins.allow`, and `channels` produces warnings (not errors) and `res.ok === true`
- All 362 existing config tests pass with zero regressions
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Downgrades "plugin not found" and "unknown channel id" config validation errors to warnings when the referenced ID is cross-referenced in both channel and plugin configuration. This prevents startup failures when a bundled plugin's directory is temporarily missing (e.g., after migrating from an external to a stock/bundled plugin).
- `src/config/validation.ts`: Channel validation now emits a warning (instead of an error) when an unknown channel key is also referenced in `plugins.entries` or `plugins.allow`. Plugin `entries`/`allow`/`deny` validation similarly downgrades to a warning when the unknown plugin ID matches a configured channel key or a channel declared by a discovered plugin. A new `isKnownChannelPlugin` helper centralizes this check.
- `src/config/config.plugin-validation.test.ts`: Adds a test simulating a missing bundled plugins directory (`OPENCLAW_BUNDLED_PLUGINS_DIR` pointed to an empty dir), verifying that `feishu` referenced across `plugins.entries`, `plugins.allow`, and `channels` produces warnings (not errors) and `res.ok === true`.
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge with minimal risk — it only relaxes validation from hard errors to warnings for a specific, well-scoped scenario.
- The changes are well-structured and narrowly scoped. The validation downgrade only applies when there is a clear cross-reference between channel config and plugin config, making accidental bypasses unlikely. Existing tests pass and a new test covers the target scenario. One minor test hygiene suggestion was noted (clearing the registry cache in the finally block) but it does not affect correctness.
- No files require special attention.
<sub>Last reviewed commit: c2b384a</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#20499: test(plugins): add bundled+config duplicate discovery regression
by dcol91863 · 2026-02-19
81.5%
#20889: fix: suppress duplicate warning for virtual auto-enabled entries
by akramcodez · 2026-02-19
80.8%
#9268: Fix: Register feishu as official channel in CHAT_CHANNEL_ORDER
by vishaltandale00 · 2026-02-05
79.4%
#12849: fix(plugins): fallback bundled channel specs when npm install retur...
by vincentkoc · 2026-02-09
79.1%
#12084: fix: prevent false duplicate plugin warning for bundled channel plu...
by shadril238 · 2026-02-08
78.7%
#14795: fix: skip disabled channel plugins in cross-context messaging checks
by explainanalyze · 2026-02-12
78.1%
#21660: fix(plugins): require explicit allowlist for non-bundled plugins
by AI-Reviewer-QS · 2026-02-20
77.2%
#7204: Plugins: default non-bundled plugins off
by veganmosfet · 2026-02-02
77.1%
#20424: Fix plugin extension path traversal in discovery/install
by markmusson · 2026-02-18
76.8%
#21871: fix(plugins): suppress false duplicate warning when user-installed ...
by hydro13 · 2026-02-20
76.6%