Skip to content

bug: out-of-tree file:// plugins never get @opencode-ai/plugin installed #1298

Description

@anandgupta42

Found during the v0.11.1 release review (End User persona). Deferred because: pre-existing behavior (v0.11.0's unconditional install had the same target-directory logic), not a regression, and the fix needs a decision on where dependencies for out-of-tree plugins should live.

A plugin declared as "plugin": ["file:///abs/path/outside/any/config/dir/plugin.ts"] never gets @opencode-ai/plugin installed anywhere: ConfigPlugin.needsDependencies (packages/opencode/src/config/plugin.ts) only installs into config directories that contain the plugin file, and Bun resolves the plugin's import "@opencode-ai/plugin" by walking up from the plugin file's own path, which nothing populates. The import fails unless the user happens to have the package on an ancestor path.

Options: install into the plugin file's own directory (or nearest package root), document that out-of-tree file plugins must provide their own node_modules, or resolve @opencode-ai/plugin from the CLI's bundled copy via an import map.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions