Repository navigation
fix(antigravity): write Stop handlers bare in hooks.json, per the vendor schema - #208
Merged
Merged
Conversation
…dor schema
Antigravity rejected the hooks.json agentseam's antigravity entry produced:
`invalid hook "agentseam": command hook must specify 'command'` (a maintainer's
Antigravity IDE language_server.log, 2026-10-17), so no hook loaded.
antigravity.google/docs/hooks (read 2026-10-17): "The `hooks.json` file maps hook
names to their event configurations". Its example gives the tool events
{matcher, hooks} groups and the matcher-ignored events (SessionStart,
PreInvocation) bare {type, command} handlers; its events table marks Stop
"N/A (matcher ignored)". agentseam wrote Stop as a {hooks} group, which has no
`command` of its own.
- hook_entry gains `flat_events` (wire events whose handlers sit bare in the
event's list) and `default_match` now applies to hooks_map as well;
antigravity sets flat_events [Stop] and default_match "*" (documented: "`*`:
Match all tools"), so every tool-event group carries a matcher as in the docs.
- Golden fixture, generated example, recount and matrix notes follow.
- Basis stays vendor-docs; nothing is marked witnessed. The corrected file has
not been run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Jothi Mani Rajendran <250249270+jothimani-rajendran@users.noreply.github.com>
jothimani-rajendran
marked this pull request as ready for review
October 17, 2026 17:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
hook_config()forantigravitynow writes Stop's handler bare ({"type": "command", "command": ...}) instead of inside a{"hooks": [...]}group, and gives every PreToolUse/PostToolUse group a matcher ("*"when the caller passes none). A maintainer's Antigravity IDE log (2026-10-17) rejected the old file withinvalid hook "agentseam": command hook must specify 'command', so none of its hooks loaded.Before:
{"agentseam": {"PreToolUse": [{"hooks": [{"type": "command", "command": "guard"}]}], "Stop": [{"hooks": [{"type": "command", "command": "guard"}]}]}}After:
{"agentseam": {"PreToolUse": [{"matcher": "*", "hooks": [{"type": "command", "command": "guard"}]}], "Stop": [{"type": "command", "command": "guard"}]}}Claim check
vendor-docs, and nothing is marked witnessed.MATRIXrow carries averifiedrecord. Only the antigravity row's notes change: they record the corrected shape, the observed rejection, and that the corrected file has not been run.hooks.jsonfile maps hook names to their event configurations". The example givesPreToolUse/PostToolUse{matcher, hooks}groups. It givesPreInvocationandSessionStartbare{"type": "command", "command": ...}items.Stopas "N/A (matcher ignored)", the same asPreInvocation/SessionStart. The docs give no explicit Stop example, so treating Stop as bare is inferred from that class, and the observed log error supports it.\"\"or\"*\": Match all tools."command| string | Required."Checks
pytest -qpasses (2617 passed, 6 skipped, local)ruff check .andruff format --check .passgit commit -s)Notes for the reviewer
hook_entry.flat_eventsfield (schema + recount derive it from the golden fixture).default_matchnow also applies to thehooks_mapwrapper; only antigravity sets either field, and the other vendors' golden fixtures are byte-identical."*"default matcher is a deviation beyond the minimum fix. Every grouped example in the docs carries a matcher. If Antigravity tells grouped entries from bare ones by thematcherkey, a group without one would hit the same error."*"is documented to match all tools.Generated by Claude Code