fix(cli): opencode run drops a Stop hook's continuation
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 70/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- node.js, typescript
调研方向
Start with opencode-hooks-bridge.ts and the shipped opencode-events.js asset, then trace how the Stop hook handles session.idle and calls client.session.promptAsync(...). Reproduce with opencode run using the issue’s described setup and compare with opencode serve plus opencode run --attach. Done when a blocking Stop hook continues the turn once under non-interactive opencode run.
由索引模型根据 Issue 内容生成。
描述
Description
Under opencode run (non-interactive), a Stop hook's continuation never reaches the session. The bridge generated into .opencode/plugin/<plugin>-hooks.js runs the Stop script on session.idle, reads its {"decision":"block","reason"}, then calls client.session.promptAsync(...) without awaiting it. opencode run exits once the session is idle, so the prompt is lost.
Affected file(s)
The OpenCode and Kilo hooks bridge generator (opencode-hooks-bridge.ts and the opencode-events.js asset it ships).
Expected behaviour
A Stop script that blocks continues the turn once, under opencode run as under opencode serve or the TUI.
Observed behaviour
opencode run: the session ends on the model's last message;opencode export <session>shows no follow-up message.opencode serveplusopencode run --attach: the follow-up arrives (the reason is the next user message).- The Stop script itself answers correctly: run by hand with a Stop payload,
memory.cjs hookprints the block.
Repro: a project with aidd-context translated flat for opencode, a committed aidd_docs/memory/vcs.md, then opencode run "remove one line of aidd_docs/memory/vcs.md with your edit tool".
AI tool
OpenCode (Kilo shares the bridge, not tested)
Additional context
Only the non-interactive mode is affected: scripts and CI. Fix candidates: await the prompt before the handler returns, or keep the run alive until a pending continuation is sent.
- 主要语言
- TypeScript
- 星标
- 481
- 派生
- 45
- 平均合并
- 1 天 13 小时
- 30 天内合并 PR
- 91
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ai-driven-dev/framework 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 86/100
ai-driven-dev/framework#1311 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
ai-driven-dev/framework#1244 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
ai-driven-dev/framework#1197 ·
维护者通常 1 天内回复
-
refactor(aidd-context): apply the new skill template to learn可能已有人在做 @blafourcade 于 3 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
ai-driven-dev/framework#1186 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
ai-driven-dev/framework#1163 · 1 条评论 ·
维护者通常 1 天内回复
查看 ai-driven-dev/framework 的全部 Issue
相似的 Issue
-
db-d1-sqlite: upsert is aliased to updateOne, so payload.kv.set never inserts new keys可能已有人在做 @pcbeingused333 今天认领。 未关闭Bug db: d1-sqlite Payload OSS
难度 2/5 1-3 小时 新手友好度 76/100
payloadcms/payload#19766 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
device-management-toolkit/sample-web-ui#3711 ·
维护者通常 1 天内回复
-
bug impact:low Team: SecuritySolution Team:Defend Workflows v9.6.0
难度 2/5 1-3 小时 新手友好度 72/100
elastic/kibana#306401 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
agentes-chat/agentes-chat#927 ·
维护者通常 1 天内回复
-
Closing a pinned tab jumps to the Tabs section instead of the next open pinned tab可能已有人在做 @seenimohamed 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
ardia-browser/ardia#2769 ·
维护者通常 1 天内回复