fix(plugins): harden bundled install/uninstall sweep#72722
Conversation
Greptile SummaryThis PR hardens bundled plugin install/uninstall by separating "persist install record + load path" from "enable plugin entry" for config-gated plugins (e.g., Confidence Score: 4/5Safe to merge; all findings are P2 and the author explicitly smoke-tested the telegram and memory-lancedb paths. No P0/P1 issues found. The three P2 comments cover: a behavioral change for channel-plugin installs that skips setting channels.* (intentional per smoke test, but not explicitly documented), an empty entries: {} side-effect in prepareConfigForDisabledBundledInstall, and a duplicate isRecord helper. src/cli/plugins-install-persist.ts — the updateChannelConfig: false option now applies to all installs, not just config-gated ones; worth verifying channel plugin behavior end-to-end if the system reads channels..enabled at startup.
|
| : enablePluginInConfig(installConfig, params.pluginId, { | ||
| updateChannelConfig: false, | ||
| }).config; |
There was a problem hiding this comment.
updateChannelConfig: false silently changes behavior for all installs
updateChannelConfig: false is passed for every non-disabled install, not just config-gated ones. Previously, persistPluginInstall for a built-in channel plugin (e.g., telegram) would write channels.telegram.enabled = true via setPluginEnabledInConfig; with this option the branch is skipped and channels.* is never touched during install. If the runtime reads channels.<id>.enabled to gate channel startup, channel plugins installed via plugins install telegram will no longer be activated until plugins enable telegram is run explicitly.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/cli/plugins-install-persist.ts
Line: 78-80
Comment:
**`updateChannelConfig: false` silently changes behavior for all installs**
`updateChannelConfig: false` is passed for every non-disabled install, not just config-gated ones. Previously, `persistPluginInstall` for a built-in channel plugin (e.g., `telegram`) would write `channels.telegram.enabled = true` via `setPluginEnabledInConfig`; with this option the branch is skipped and `channels.*` is never touched during install. If the runtime reads `channels.<id>.enabled` to gate channel startup, channel plugins installed via `plugins install telegram` will no longer be activated until `plugins enable telegram` is run explicitly.
How can I resolve this? If you propose a fix, please make it concise.
Summary
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
Regression Test Plan (if applicable)
User-visible / Behavior Changes
Bundled plugins that require config can be installed before credentials/config are present; they remain disabled until configured and explicitly enabled.
Diagram (if applicable)
Security Impact (required)
Repro + Verification
Environment
Steps
Expected
Actual
Evidence
Human Verification (required)
Review Conversations
Compatibility / Migration
Risks and Mitigations