feat(cli): relay PreToolUse and UserPromptSubmit on OpenCode and Kilo, and warn about hooks it skips
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
Start with the OpenCode bridge at cli/src/contexts/tools/domain/profiles/opencode/opencode-hooks-bridge.ts and the corresponding Kilo bridge; compare their event handling with the native tool.execute.before and chat.message events described in the issue. Check how the build reports unsupported hooks and update plugins/aidd-context/skills/08-hook-generate/references/tool-paths.md. Verify the acceptance criteria with probes, including whether PreToolUse can deny a tool call.
由索引模型根据 Issue 内容生成。
描述
Problem
The OpenCode and Kilo hooks bridge relays only SessionStart, PostToolUse and Stop (cli/src/contexts/tools/domain/profiles/{opencode,kilo}/*-hooks-bridge.ts). PreToolUse and UserPromptSubmit hooks are skipped without a warning. Both tools expose a native equivalent that fires.
Measured on 2026-11-11 with a probe plugin in a disposable folder, non-interactive:
- OpenCode 1.19.3,
opencode run:tool.execute.beforefires forwriteandbash;chat.messagefires for the prompt. - Kilo 7.7.5,
kilo run: same two hooks fire.
So a framework hook declared on PreToolUse or UserPromptSubmit silently does nothing on these two tools. This is a bridge limit, not a tool limit.
Scope
- Relay
PreToolUsethroughtool.execute.beforeandUserPromptSubmitthroughchat.message, for OpenCode and Kilo. - Report an event the bridge does not relay (a warning at build time), instead of skipping it silently.
- Update
plugins/aidd-context/skills/08-hook-generate/references/tool-paths.md, which says OpenCode is not supported.
Acceptance criteria
- A
PreToolUsescript runs before a tool call on OpenCode and Kilo. - A
UserPromptSubmitscript runs on each user prompt on OpenCode and Kilo. - Whether a
PreToolUsescript can deny a tool call (throw, or changeargs) is verified by a probe and documented. It is not verified today. - A build warns about every hook event it does not relay.
Prior art in this repo
cli/src/contexts/tools/domain/profiles/opencode/opencode-hooks-bridge.ts(three relayed events).- #1191 (Stop continuation lost under
opencode run), #978 (verified tool compatibility), #676 (OpenCode through its plugin API).
Out of scope
The Stop continuation under opencode run (#1191). Adding other events (SubagentStop, SessionEnd).
- 主要语言
- 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 天内回复