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
Failed to load plugin file:///real/path/to/plugins/my-plugin.js: Cannot find module '@opencode-ai/plugin' #23553
In config/plugin.ts, the Glob.scan call uses follow: true (via symlink: true), and absolute: true. The glob library resolves through symlinks and returns the real path of matched files. This real path is then converted to a file:// URL and passed to import().
When Bun (or Node) imports from the real path, it resolves @opencode-ai/plugin relative to the real directory — not the symlink location where node_modules actually exists.
Reproduction
Create plugins in a separate directory (e.g. /some/other/path/plugins/)
Symlink ~/.config/opencode/plugins to that directory
Ensure the plugin imports from @opencode-ai/plugin
Have a package.json in ~/.config/opencode/ with @opencode-ai/plugin as a dependency
Start opencode — plugin fails to load
Expected behavior
Plugins discovered through symlinked directories should resolve dependencies from the config directory's node_modules, not from the symlink target's directory tree.
Suggested fix
Pass realpath: false to the glob options in config/plugin.ts (and possibly tool/registry.ts which has the same pattern for custom tools), so that returned paths preserve the symlink path rather than resolving to the real path.
Activity
github-actions commentedon Apr 20, 2026
This issue might be a duplicate of existing issues. Please check:
@opencode-ai/pluginbecause Bun follows the symlink and resolves the module relative to the real path instead of the config directory. Same error, same underlying mechanism (though Custom tools via symlinks fail to resolve @opencode-ai/plugin module #11001 focused ontool/registry.tsand your report also coversconfig/plugin.ts).If your issue is not fully addressed by those, please add a comment explaining what's different so it can be kept open.
github-actions commentedon Jul 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.