Skip to content

Fix duplicate marketplace plugin loading#364

Merged
kevincodex1 merged 1 commit intoGitlawb:mainfrom
joetam:fix/plugin-dup-marketplace-collision
Apr 5, 2026
Merged

Fix duplicate marketplace plugin loading#364
kevincodex1 merged 1 commit intoGitlawb:mainfrom
joetam:fix/plugin-dup-marketplace-collision

Conversation

@joetam
Copy link
Copy Markdown
Contributor

@joetam joetam commented Apr 4, 2026

Fixes a bug where if someone has plugins from the legacy claude-code-plugins repo installed, and the same plugin from claude-plugins-official, it blocks user input when the session starts.

Repro:

  • 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

Testing

before: starting openclaude hangs and can't type anything
after: inputs are now accepted

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
@joetam joetam force-pushed the fix/plugin-dup-marketplace-collision branch from 7e4405a to 8c6f0fe Compare April 4, 2026 21:54
gnanam1990
gnanam1990 approved these changes Apr 5, 2026
Copy link
Copy Markdown
Collaborator

@gnanam1990 gnanam1990 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Copy link
Copy Markdown
Collaborator

@Vasanthdev2004 Vasanthdev2004 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 before verifyAndDemote(), 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 -> success
  • bun 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.

@joetam
Copy link
Copy Markdown
Contributor Author

joetam commented Apr 5, 2026

what does this merge block mean? is there anything i need to kick off on my end?
CleanShot 2026-04-05 at 11 44 42@2x

@kevincodex1 kevincodex1 merged commit daf2c90 into Gitlawb:main Apr 5, 2026
1 check passed
euxaristia pushed a commit to euxaristia/openclaude that referenced this pull request Apr 13, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants