Skip to content

Conversation

@riatzukiza
Copy link
Contributor

@riatzukiza riatzukiza commented Nov 3, 2025

Scoped Plugin Bug

  • Loader currently does plugin.split("@") (packages/opencode/src/plugin/index.ts:37), so a scoped name like @promethean-os/opencode-openai-codex-auth becomes pkg === "" and version === "promethean-os/opencode-openai-codex-auth".
  • BunProc.install then records that empty package key in the cache manifest (packages/opencode/src/bun/index.ts:60-94), producing "": "promethean-os/opencode-openai-codex-auth" and never installing the real module. The follow-up import resolves to /home/err/.cache/opencode/node_modules, triggering the “Cannot find module …” error you’re seeing.
  • Parse plugin strings from the rightmost @ (or use npm-package-arg) so scoped packages stay intact, e.g. const at = plugin.lastIndexOf("@"); const pkg = at > 0 ? plugin.slice(0, at) : plugin; const version = at > 0 ? plugin.slice(at + 1) : "latest";.
  • After patching, clear ~/.cache/opencode and restart so the dependency file is regenerated with the correct scoped package key.
    Next step: adjust the loader parsing logic and rebuild; rerun with the scoped plugin to confirm it resolves.

closes: #3392

tmp
dist
.turbo
**/.serena
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added these because my bot would have dumped a load of memory files you may not want, and this is a common/popular agent framework that people should be able to/allowed to use on this project with out polluting the git.

@rekram1-node rekram1-node self-assigned this Nov 3, 2025
@rekram1-node rekram1-node changed the title Feat/allow scoped npm plugins fix: support scoped npm plugins Nov 3, 2025
@rekram1-node rekram1-node force-pushed the feat/allow-scoped-npm-plugins branch from 4ead262 to 823ed63 Compare November 4, 2025 15:10
@rekram1-node rekram1-node merged commit 6f00286 into sst:dev Nov 4, 2025
3 checks passed
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.

[bug] Add scoped npm package as plugin shows error on startup

2 participants