← Back to PRs

#12084: fix: prevent false duplicate plugin warning for bundled channel plugins

by shadril238 open 2026-02-08 20:43 View on GitHub →
### Problem Built-in channel plugins (like mattermost) trigger "duplicate plugin id" warnings on every restart when configured via `channels.<name>`, even with no explicit plugin entry in config. ### Solution Changed `seenIds` from `Set<string>` to `Map<string, string>` in the manifest registry to track plugin root directories. Now only emits the warning when the same plugin ID is found from **genuinely different** source locations. <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adjusts plugin manifest registry duplicate-id detection to avoid warnings when a bundled channel plugin is discovered multiple times from the same location. It changes `seenIds` from a `Set<string>` to a `Map<string, string>` keyed by plugin id, storing the first-seen plugin root directory and only warning when a later candidate with the same id comes from a different root directory. This fits into the plugin discovery/load flow in `src/plugins/*` by refining the diagnostic emitted during `loadPluginManifestRegistry` candidate iteration, without changing manifest parsing or record construction. <h3>Confidence Score: 4/5</h3> - This PR is likely safe to merge, but may still emit false duplicate warnings in common symlinked/volume-mounted setups. - Change is localized to diagnostics and does not affect plugin loading behavior beyond when a warning is emitted. The main remaining concern is that `path.resolve` doesn’t canonicalize symlinks, so the original warning spam can still occur when the same plugin is reachable via both a symlink and its real path, which is plausible in dev/container environments. - src/plugins/manifest-registry.ts <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs