Skip to content

[Bug] Plugin loader fails due to inconsistent directory structure in ~/.cache/opencode/packages #23502

@KaysonSear

Description

@KaysonSear

While troubleshooting a plugin loading failure (oh-my-openagent), I discovered that the 'opencode plugin install' command creates a nested structure in '/.cache/opencode/packages/@latest/node_modules//'. However, the plugin loader (service=plugin) seems to expect the entry point at '/.cache/opencode/packages/@latest/node_modules/package.json'.

This results in the following error:
'ERROR service=plugin path=oh-my-openagent@latest error=ENOENT: no such file or directory, open /home/user/.cache/opencode/packages/oh-my-openagent@latest/node_modules/package.json failed to resolve plugin server entry'

Manual fix involves symlinking the nested package.json to the root of node_modules. Additionally, it appears that the REAL active plugins are resolved from '~/.cache/opencode/node_modules/', leading to confusion when 'opencode plugin install' creates a separate 'packages/' directory that is then partially ignored or incorrectly resolved by the runtime.

Tested on opencode v1.14.18.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions