Skip to content

fix(deps): add missing @opencode-ai/plugin to dependencies - #5797

Merged
rekram1-node merged 6 commits into
anomalyco:devfrom
HelloGGX:fix/cannot-find-module-opencode-ai-plugin
Dec 21, 2025
Merged

rekram1-node merged 6 commits into
anomalyco:devfrom
HelloGGX:fix/cannot-find-module-opencode-ai-plugin

Conversation

@HelloGGX

Copy link
Copy Markdown
Contributor

Description

This PR fixes a Cannot find module error encountered when running tools that rely on @opencode-ai/plugin.

The Problem

As described in issue #2802, running scripts like .opencode/tool/github-triage.ts fails with the following error because the plugin package was missing from the dependencies list:

error: Cannot find module '@opencode-ai/plugin' from ...

The Fix

I have added "@opencode-ai/plugin": "workspace:*" to the dependencies section in package.json. This ensures the module is correctly linked and available for the tools to use.

Related Issue

Fixes #2802

@rekram1-node

Copy link
Copy Markdown
Collaborator

Btw this won't fix that persons issue, they had an in general request for:

allow running custom tools without external dependencies

That would mean no requirement of this dep at all (not possible rn)

ALso if u run opencode in opencode repo itll auto install this dep, so idk if we need to include in root package.json?

@HelloGGX

Copy link
Copy Markdown
Contributor Author

I encountered a Cannot find module '@opencode-ai/plugin' error when attempting to run the internal tools (specifically github-triage.ts) within the OpenCode repository.

Cause:
The script .opencode/tool/github-triage.ts imports { tool } from @opencode-ai/plugin, but this package is missing from the root package.json dependencies. In a pnpm workspace, this prevents the module from being correctly symlinked and resolved during local execution.

Proposed Solution:
Add @opencode-ai/plugin to the dependencies section of the root package.json using the workspace:* protocol:

"dependencies": {
  ...
  "@opencode-ai/plugin": "workspace:*",
  "@opencode-ai/script": "workspace:*",
  "@opencode-ai/sdk": "workspace:*",
  ...
}

Verification:
After adding the dependency and running pnpm install, the module resolution works as expected and the triage tool runs successfully.

Best regards,
Sherlock Holmes

Btw this won't fix that persons issue, they had an in general request for:

allow running custom tools without external dependencies

That would mean no requirement of this dep at all (not possible rn)

ALso if u run opencode in opencode repo itll auto install this dep, so idk if we need to include in root package.json?

@JoshuaDietz

JoshuaDietz commented Dec 21, 2025 •

Copy link
Copy Markdown

Btw this won't fix that persons issue, they had an in general request for:

allow running custom tools without external dependencies

That would mean no requirement of this dep at all (not possible rn)

ALso if u run opencode in opencode repo itll auto install this dep, so idk if we need to include in root package.json?

I'm on NixOS, so naturally the automatic install fails because of the readonly filesystem and opencode will not work anymore when a plugin is installed. For every message I just get:

Cannot find module '@opencode-ai/plugin from 'path/to/my/plugin'

So I would be really greatful if this was included so I can use plugins on NixOS

Edit: I'm not sure anymore if this would solve my problem or if the reason why it cannot find the plugin is that my plugin file can just not find the already installed plugin

@rekram1-node
rekram1-node merged commit 85d3604 into anomalyco:dev Dec 21, 2025
3 checks passed
@rekram1-node

Copy link
Copy Markdown
Collaborator

this would only fix ur issue if u are running in the opencode repo, we need to figure out better solution for elsewhere

Destreyf pushed a commit to Destreyf/opencode that referenced this pull request Dec 22, 2025
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request Jun 14, 2026
meSingh pushed a commit to meSingh/opencode that referenced this pull request Sep 6, 2026
androidand pushed a commit to androidand/opencode-skein that referenced this pull request Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

allow running custom tools without external dependencies

3 participants