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

Ouverte
#1,193 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
48/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Active
Stack technique
typescript
Domaine
cli, tooling

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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

Langage dominant
TypeScript
Étoiles
481
Forks
45
Merge moyen
1 j 13 h
PR mergées (30 j)
91

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de ai-driven-dev/framework

Toutes les issues de ai-driven-dev/framework

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.