Fix duplicate marketplace plugin loading#364
Conversation
Reproduction: - Enable `frontend-design@claude-code-plugins` - Enable `frontend-design@claude-plugins-official` - Start OpenClaude with both marketplace plugins active - Both plugins load, but downstream command and skill scopes key off the short plugin name, so both collapse to `frontend-design` and can interfere with interactive startup Fix: - Collapse duplicate marketplace plugins by short name during merge - Keep the enabled copy when enabled state differs; otherwise keep the later config entry - Add regression coverage for both cases
7e4405a to
8c6f0fe
Compare
gnanam1990
left a comment
There was a problem hiding this comment.
Thank you for this valuable contribution! This PR effectively resolves the issue of duplicate marketplace plugin loading that was causing input hangs on startup. Your approach to collapse duplicates by short plugin name while respecting the enabled state is both elegant and practical.\n\nThe fix improves the stability and usability of the plugin system with minimal risk and scope. I also appreciate the clear reproduction steps and detailed explanation provided.\n\nA few minor suggestions for future improvements:\n- Clarifying or expanding the regression test coverage to explicitly cover duplicate plugin scenarios would increase confidence.\n- Considering edge cases where duplicates differ in config or version could be beneficial.\n- Confirming that caches are properly invalidated after deduplication will help maintain data consistency.\n- Adding debug logging during plugin merges might assist future diagnostics.\n\nThese points are not blockers and can be addressed iteratively in follow-up work.\n\nOverall, this is a well-implemented and valuable fix. I\u2019m happy to approve it. Thank you again for your thoughtful contribution!
Vasanthdev2004
left a comment
There was a problem hiding this comment.
Rechecked the latest head 8c6f0fefc44ae38930682f58333cfd0a65feaf18.
I did not find a blocker on the current implementation.
What I verified on this head:
- read the merge point in
mergePluginSources()and confirmed the duplicate-marketplace collapse happens beforeverifyAndDemote(), settings caching, and downstream plugin consumers - ran the new regression tests:
bun test src/utils/plugins/pluginLoader.test.ts-> 2 pass - ran direct merge repros for the two cases this PR claims to fix:
- enabled official + disabled legacy -> only the enabled official copy remains
- both enabled -> only the later copy remains and the dropped duplicate is surfaced as an error
bun run build-> successbun run smoke-> success
Residual risk is mostly test scope rather than a concrete bug: there still isn't an end-to-end startup repro in CI for the original input-hang scenario. But given where the dedup now sits in the load pipeline, I think the fix is sound enough to merge.
Reproduction: - Enable `frontend-design@claude-code-plugins` - Enable `frontend-design@claude-plugins-official` - Start OpenClaude with both marketplace plugins active - Both plugins load, but downstream command and skill scopes key off the short plugin name, so both collapse to `frontend-design` and can interfere with interactive startup Fix: - Collapse duplicate marketplace plugins by short name during merge - Keep the enabled copy when enabled state differs; otherwise keep the later config entry - Add regression coverage for both cases

Fixes a bug where if someone has plugins from the legacy
claude-code-pluginsrepo installed, and the same plugin fromclaude-plugins-official, it blocks user input when the session starts.Repro:
frontend-design@claude-code-pluginsfrontend-design@claude-plugins-officialfrontend-designand can interfere with interactive startupFix:
Testing
before: starting openclaude hangs and can't type anything
after: inputs are now accepted