[PR #11161] fix(opencode): prevent plugin deduplication collision for index.js entry points #13669

Open
opened 2026-02-16 18:18:30 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/11161

State: open
Merged: No


Fixes #11159

Problem

getPluginName() returns only the filename for file:// URLs. Plugins with index.js/index.ts entry points all return "index", causing incorrect deduplication.

Solution

Use the package directory name when filename is index. Handles src/, dist/, lib/ patterns.

Verification

Tested with config ["oh-my-opencode", "file:///my-plugin/src/index.ts"] - both plugins now load correctly.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/11161 **State:** open **Merged:** No --- Fixes #11159 ## Problem `getPluginName()` returns only the filename for `file://` URLs. Plugins with `index.js`/`index.ts` entry points all return `"index"`, causing incorrect deduplication. ## Solution Use the package directory name when filename is `index`. Handles `src/`, `dist/`, `lib/` patterns. ## Verification Tested with config `["oh-my-opencode", "file:///my-plugin/src/index.ts"]` - both plugins now load correctly.
yindo added the pull-request label 2026-02-16 18:18:30 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13669