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

Aperta
#1,193 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
cli, tooling

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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).

Lingua principale
TypeScript
Stelle
481
Fork
45
Merge medio
1g 13h
PR unite (30g)
91

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ai-driven-dev/framework

Tutte le issue di ai-driven-dev/framework

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.