feat(cli): relay PreToolUse and UserPromptSubmit on OpenCode and Kilo, and warn about hooks it skips

未關閉
#1,193 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
48/100
Issue 類型
功能
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
typescript
領域
cli, tooling

研究方向

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.before fires for write and bash; chat.message fires 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 PreToolUse through tool.execute.before and UserPromptSubmit through chat.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 PreToolUse script runs before a tool call on OpenCode and Kilo.
  • A UserPromptSubmit script runs on each user prompt on OpenCode and Kilo.
  • Whether a PreToolUse script can deny a tool call (throw, or change args) 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

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

ai-driven-dev/framework 的其他 Issue

查看 ai-driven-dev/framework 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。