feat(cli): relay Stop, PostToolUse and PreToolUse to Antigravity (agy), not only SessionStart

Offen
#1,194 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
44/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
typescript
Bereich
cli

Rechercherichtung

Start with cli/src/contexts/tools/domain/profiles/antigravity/antigravity-hooks.ts and its MAPPED_EVENTS, then read tool-paths.md and the prior hook work in #890, #511, and #978. Verify how the profile maps event names, matchers, and hook outputs against the observed agy contracts, including PostInvocation context injection. Done means the acceptance criteria pass, including a guarded Stop continuation and an allow response for empty PreToolUse output.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Problem

On next, the Antigravity profile relays only SessionStart (cli/src/contexts/tools/domain/profiles/antigravity/antigravity-hooks.ts, MAPPED_EVENTS), with the reason "Claude and agy name their tools differently". tool-paths.md lists PreToolUse, PostToolUse and Stop as supported by the host. A hook on any of those three does nothing on agy.

Measured on 2026-11-11 with agy -p (1.5.x, the binary auto-updated from 1.5.1 to 1.5.5 during the test), project file .agents/hooks.json, disposable folder:

  • SessionStart, PreToolUse, PostToolUse, Stop all fire. agy also has PreInvocation and PostInvocation. It has no UserPromptSubmit, SubagentStop or SessionEnd.
  • Tool names differ: write_file (args Path, Content) and run_command (args CommandLine), not Write and Bash.
  • Output contract differs from the framework's scripts: a Stop hook continues the agent with {"decision":"continue","reason":...}. An empty output from a PreToolUse hook is a denial, so a script that prints nothing blocks every tool call. {"decision":"allow"} is required.
  • PostToolUse could not inject context (documented as {} only). PostInvocation injected it with {"injectSteps":[{"systemMessage":{"systemMessage":"..."}}]}.
  • In -p, tools are refused unless permissions are skipped, which matters for CI.
  • Not tested: --settings, subagent hooks. One run per test, small model.
Scope
  • Relay Stop and PostToolUse (and PreToolUse once its output contract is handled) to agy, with matchers translated (Bash to run_command, Write and Edit to write_file).
  • Translate the hook output (block to continue, an empty PreToolUse output to allow), or document that scripts must handle it.
  • Decide how PostToolUse context injection works on agy (PostInvocation).
Acceptance criteria
  • A Stop script that blocks once continues the turn on agy, with a guard that stops the loop.
  • A PostToolUse script runs after write_file and run_command.
  • A PreToolUse script that prints nothing does not deny every tool call.
  • Events the profile does not relay produce a warning at build time (today: the unmapped event message already exists for the profile).
Prior art in this repo
  • antigravity-hooks.ts (MAPPED_EVENTS = {"SessionStart"}), #890 (hooks are read from hooks.json, not settings.json), #511 (Antigravity as a flat host), #978 (verified tool compatibility).
Out of scope

Telling agy to relay UserPromptSubmit or SessionEnd (they do not exist). The Antigravity IDE.

Vorherrschende Sprache
TypeScript
Sterne
481
Forks
45
Ø Merge
1 T. 13 Std.
Gemergte PRs (30 T.)
91

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus ai-driven-dev/framework

Alle Issues in ai-driven-dev/framework

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.