Skip to content

fix(core): normalise absolute plugin paths before dedupe - #49010

Open
yuefdev wants to merge 1 commit into
anomalyco:v2from
yuefdev:fix/plugin-path-dedupe
Open

yuefdev wants to merge 1 commit into
anomalyco:v2from
yuefdev:fix/plugin-path-dedupe

Conversation

@yuefdev

@yuefdev yuefdev commented Sep 14, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #48706

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Configured local plugin paths only get resolved when they start with ./ or ../. An absolute spec is kept as typed, so C:/Users/me/.config/opencode/plugins/foo never matches the discovered C:\Users\me\...\foo target. The supervisor loads it twice, the second copy fails with Duplicate plugin ID and its options are lost.

Absolute specs now go through path.resolve too, so both spellings become the same target and the configured entry replaces the discovered one, options included. A trailing slash had the same problem on any OS.

How did you verify your code works?

Added a test in supervisor-reload.test.ts: a discovered plugin, configured again with forward slashes, a trailing slash and options. It fails before the change (options missing) and passes after. bun test test/plugin passes and bun run check is clean. Tested on Windows 11.

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

A configured plugin spelled `C:/x/plugins/foo` did not match the
auto-discovered `C:\x\plugins\foo`, so it loaded twice, failed as a
duplicate ID, and its options were dropped. Resolve absolute specs the
same way relative ones already are.
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant