[Bug]: v2 still unloadable via npm spec on OpenCode 2.0.32 — ./v2 subpath not usable as a plugin spec; ship v2 as root default export
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 1-2 天
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- bun, typescript
调研方向
Start by reading package.json and the v2 entry point at dist/src/v2/index.js; compare their exports with the plugin loader error quoted in the issue. Check how the package root and v2 export are configured, then verify that the published root entry provides the v2 definition OpenCode expects while retaining the named v1 export if needed. Done means the issue's root plugin spec, "opencode-pty", loads on OpenCode 2 without a shim.
由索引模型根据 Issue 内容生成。
描述
Summary
On OpenCode 2.0.32 (macOS arm64), [email protected] still fails to load as an npm plugin. This adds two things #67 and #83 don't cover yet:
- The
./v2subpath can't be used as a plugin spec. The README's V2 example is"plugins": ["opencode-pty/v2"], and OpenCode 2 parses that string as a package name rather than a subpath export. The only way left is a local shim file. I couldn't get one stable here: with a partial dependency tree, the plugin activation step hung (Location plugins did not finish activating) and blocked every command. I can't say whether that's the shim's fault or the adapter's. - What would fix it: publish with the v2 definition as the package's root
defaultexport, i.e.export default define({ id, setup })fromdist/index.js. You could keep the namedPTYPluginexport for v1 hosts, or gate on the host version. With that,"plugins": ["opencode-pty"]loads on v2 with no shim.
Evidence
package.jsonmain: dist/index.jsexports only the namedPTYPlugin.exports["./v2"]points todist/src/v2/index.js, which does containdefine({ id, setup }).- Load error (from
~/.local/share/opencode/log/opencode.log):Plugin must export a default definition with an id and an effect or setup function. - npm
latestis still 0.4.0, published 2026-09-18.
Related
- #67, #83: same load failure. This issue adds the subpath-spec detail and a concrete export fix.
- #80: once v2 loads, the adapter should also wire the permission authorizer, so that
permission.bashdeny/ask covers the pty tools.
- 主要语言
- TypeScript
- 星标
- 601
- 派生
- 66
- 平均合并
- 4 天 9 小时
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
shekohex/opencode-pty 的其他 Issue
-
[Bug]: exit notification delivery failures are silently swallowed — agent never wakes, no diagnostic未关闭
难度 2/5 1-3 小时 新手友好度 78/100
shekohex/opencode-pty#54 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
shekohex/opencode-pty#48 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 25/100
shekohex/opencode-pty#83 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 64/100
shekohex/opencode-pty#82 ·
维护者通常 1 天内回复
-
enhancement
难度 3/5 1-2 天 新手友好度 67/100
shekohex/opencode-pty#81 ·
维护者通常 1 天内回复
查看 shekohex/opencode-pty 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
getsentry/sentry-conventions#732 · 1 条评论 ·
维护者通常 1 天内回复
-
status:in-linear status:team-assigned team:nodes
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
motiondivision/motion#3955 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 68/100
equinor/prisma-decision-web#919 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 83/100