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
Disabled project-local custom tools can crash startup when .opencode deps are missing #22061
OpenCode crashes during startup in a project that contains a repo-local custom tool under .opencode/tool, even when that tool is disabled in .opencode/opencode.jsonc.
In this repo, .opencode/tool/github-pr-search.ts imports @opencode-ai/plugin, and the local config sets:
"tools": {
"github-pr-search": false
}
Even so, OpenCode still imports the tool module before the disable flag is applied, and startup fails with:
error: Cannot find module '@opencode-ai/plugin' from '/Users/yuhan/workspace/oss/opencode/.opencode/tool/github-pr-search.ts'
The local .opencode/package.json exists and declares @opencode-ai/plugin, but .opencode/node_modules is missing. From reading the source, the config dependency install path also appears to swallow install failures, which can leave the config directory partially prepared and later surface as this import error.
Plugins
None. This is using repo-local custom tools under .opencode/tool, not external plugins.
OpenCode version
1.4.3
Steps to reproduce
Open a repo that contains a custom tool file under .opencode/tool/*.ts.
Have that tool import @opencode-ai/plugin at the top level.
Ensure .opencode/package.json exists but .opencode/node_modules is missing, or dependency installation does not complete.
Disable the tool in .opencode/opencode.jsonc with "github-pr-search": false.
Start OpenCode in that repo.
Screenshot and/or share link
Screenshot not attached yet. The error shown was:
error: Cannot find module '@opencode-ai/plugin' from '/Users/yuhan/workspace/oss/opencode/.opencode/tool/github-pr-search.ts'
This issue might be a duplicate of existing issues. Please check:
Custom tool loading crashes on transient dependency install failures #13784: Custom tool loading crashes on transient dependency install failures — describes the same silent bun install failure swallowing and custom tool crash behavior; your issue adds the additional angle of disabled tools being eagerly imported before the disable flag is applied.
That issue covers custom tool crashes after dependency install failures. This report adds that a repo-local custom tool can still be eagerly imported even when it is disabled in .opencode/opencode.jsonc, which looks like a separate loading/ordering bug.
Activity
github-actions commentedon Apr 11, 2026
This issue might be a duplicate of existing issues. Please check:
bun installfailure swallowing and custom tool crash behavior; your issue adds the additional angle of disabled tools being eagerly imported before the disable flag is applied.Astro-Han commentedon Apr 12, 2026
Related to #13784, but not exactly the same.
That issue covers custom tool crashes after dependency install failures. This report adds that a repo-local custom tool can still be eagerly imported even when it is disabled in
.opencode/opencode.jsonc, which looks like a separate loading/ordering bug.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.