You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: file:// plugins with same filename incorrectly deduplicated #8759
Multiple file:// plugins with the same entry point filename (e.g., index.js) are incorrectly treated as duplicates during plugin loading, causing only the last one to load.
Steps to Reproduce
Create a config with multiple file:// plugins using standard entry points:
OPENCODE_LOG_LEVEL=DEBUG opencode run "test"2>&1| grep "loading plugin"
Observe that only the last plugin loads
Expected Behavior
All three plugins should load since they have different paths.
Actual Behavior
Only plugin-c loads. The deduplication logic in getPluginName() extracts only the filename ("index") for all three plugins, marking them as duplicates.
Root Cause
In packages/opencode/src/config/config.ts, the getPluginName() function extracts only the filename for file:// URLs:
if(plugin.startsWith("file://")){returnpath.parse(newURL(plugin).pathname).name// Returns "index" for all}
This was designed for npm package deduplication but doesn't account for file:// plugins where:
Multiple plugins may use the same filename (standard practice: index.js)
Plugins in different directories should not be considered duplicates
Even plugins in the same directory with different filenames should be allowed
Impact
Users cannot use multiple local plugins with standard entry point names
No warning is shown when plugins are silently dropped
Workaround requires renaming entry points to unique names (non-standard)
Environment
OpenCode version: 1.1.23
Node/Bun version: Bun 1.3.5
OS: Linux
Related
This affects anyone using local plugin development with standard JavaScript conventions.
This is addressed by #15598 which adds node_modules-aware path parsing to getPluginName(). CI is green.
The root cause is that import.meta.resolve resolves npm plugins to file://…/node_modules/<pkg>/dist/index.js, and then getPluginName() extracts only the filename "index", causing false collisions with any project plugin that also has an index.ts entry point.
Activity
github-actions commentedon Jan 15, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
fix: properly encode file URLs with special characters (anomalyco#11790)
fix: properly encode file URLs with special characters (anomalyco#11790)
cyberprophet commentedon Mar 4, 2026
This is addressed by #15598 which adds node_modules-aware path parsing to
getPluginName(). CI is green.The root cause is that
import.meta.resolveresolves npm plugins tofile://…/node_modules/<pkg>/dist/index.js, and thengetPluginName()extracts only the filename"index", causing false collisions with any project plugin that also has anindex.tsentry point.Related issues: #8759, #10115, #11159, #12285, #14304, #15591
fix(config): use package.json name for file:// plugin identity
github-actions commentedon May 4, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.