Repository navigation
Done
Done
Feature
Copy link
Description
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,Stopall fire.agyalso hasPreInvocationandPostInvocation. It has noUserPromptSubmit,SubagentStoporSessionEnd.- Tool names differ:
write_file(argsPath,Content) andrun_command(argsCommandLine), notWriteandBash. - Output contract differs from the framework's scripts: a
Stophook continues the agent with{"decision":"continue","reason":...}. An empty output from aPreToolUsehook is a denial, so a script that prints nothing blocks every tool call.{"decision":"allow"}is required. PostToolUsecould not inject context (documented as{}only).PostInvocationinjected 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
StopandPostToolUse(andPreToolUseonce its output contract is handled) toagy, with matchers translated (Bashtorun_command,WriteandEdittowrite_file). - Translate the hook output (
blocktocontinue, an emptyPreToolUseoutput toallow), or document that scripts must handle it. - Decide how
PostToolUsecontext injection works onagy(PostInvocation).
Acceptance criteria
- A
Stopscript that blocks once continues the turn onagy, with a guard that stops the loop. - A
PostToolUsescript runs afterwrite_fileandrun_command. - A
PreToolUsescript that prints nothing does not deny every tool call. - Events the profile does not relay produce a warning at build time (today: the
unmapped eventmessage already exists for the profile).
Prior art in this repo
antigravity-hooks.ts(MAPPED_EVENTS = {"SessionStart"}), fix(aidd-context): the memory hook wired into ~/.gemini/settings.json never runs under Antigravity, and fails silently #890 (hooks are read fromhooks.json, notsettings.json), feat(cli): support Antigravity CLI as a flat host #511 (Antigravity as a flat host), docs(framework): define verified tool compatibility and tool onboarding #978 (verified tool compatibility).
Out of scope
Telling agy to relay UserPromptSubmit or SessionEnd (they do not exist). The Antigravity IDE.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsDone
Activity
blafourcade commentedon Nov 25, 2026
Partly landed in next with #1253 (364ca04):
StopandPostToolUseare relayed toagy;Stopcontinues with{"decision":"continue"}once,PostToolUseruns afterwrite_fileandrun_command, and every event not relayed warns at build time. Remaining: plugin matchers are not translated (everyPostToolUsehandler uses*);PreToolUserelay is part of #1342; injecting context after a tool throughPreInvocationis tracked in #1350. Keeping this open for the matcher translation.blafourcade commentedon Nov 25, 2026
Delivered on
next, checked against the current code after the CLI convergence (#1253) and the follow-up merges.Evidence:
antigravity.tsevents SessionStart, PreToolUse, PostToolUse, Stop; #1355 tool names (host-tool-names.ts,antigravity-hooks.model.unit.test.ts);host-antigravity.cjscontinueTurn->decision: continuewith no re-continue of a continuation; silent PreToolUse answers allow;unmapped event ... skippedwarning inwrapped-command-hooks-merge.tsClosing as completed. Reopen with a reproduction if something is still missing.