Skip to content

fix(antigravity): flat hook lists for matcher-less events, SessionStart, and no MCP type - #3584

Merged
dyoshikawa merged 3 commits into
mainfrom
resolve-issue-2666-antigravity-2026-10-22
Oct 22, 2026
Merged

dyoshikawa merged 3 commits into
mainfrom
resolve-issue-2666-antigravity-2026-10-22

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Follows up the 2026-10-22 re-check on #2666 for antigravity-ide, antigravity-cli and antigravity-plugin.

Hooks: flat handler lists for matcher-less events (gap 1)

The Antigravity hooks docs say that for SessionStart, PreInvocation, PostInvocation and Stop "the structure is simpler (a list of handlers directly under the event key) and the matcher is ignored". Only PreToolUse / PostToolUse use the { "matcher", "hooks": [...] } group. rulesync wrapped every event in a group, which agy plugin validate 1.4.4 reports as command hook must specify 'command'. The loader skips this whole file. So any config with stop or a model-invocation hook disabled all of the user's Antigravity hooks.

  • Generation now writes "Stop": [ { "type": "command", "command": "..." } ] (handlers from several matcher groups are merged into the one list; a matcher there is still dropped with the existing warning).
  • Import accepts the flat form and still accepts the older grouped form, so files written by earlier rulesync versions keep importing.
  • Applies to .agents/hooks.json, ~/.gemini/config/hooks.json and the plugin hooks.json (shared code path).

Hooks: SessionStart (gap 2)

SessionStart ("Fires once when a new conversation session starts, before the first model invocation") is now documented, so canonical sessionStart maps to SessionStart and is a flat, matcher-less event. The hook-event matrix is regenerated.

MCP: no type, no empty stdio fields on remote servers (gap 3, partial)

The Antigravity MCP docs list command, serverUrl, args, env, cwd, headers, authProviderType, oauth, disabled and disabledTools; there is no type, and the transport follows from command / serverUrl. The canonical type is no longer written. Per the issue's validator run, a serverUrl server that also has args / env (even "env": {}) fails to start, so an empty args / env on a remote server is dropped. Import is unchanged (it does not invent a type).

Docs (docs/reference/file-formats.md) and the embedded docs content are updated.

Left for maintainer

  • A remote MCP server with a non-empty command / args / env: drop with a warning, or keep? That is a design call, so it is left as is.
  • Other canonical MCP fields Antigravity does not document (e.g. timeout) are still passed through; whether to strip them is a broader allow-list decision.
  • I could not run agy plugin validate locally; the validator outputs are taken from the issue comment, while the shapes are checked against the official docs above.

Sources

Refs #2666

🤖 Generated with Claude Code

https://claude.ai/code/session_012y9fNo2AAJdGocxvsHtDhv

dyoshikawa and others added 3 commits October 22, 2026 12:00
…Start, drop MCP type

Antigravity's hooks.json takes a flat handler list under SessionStart,
PreInvocation, PostInvocation and Stop; only PreToolUse/PostToolUse use the
{ matcher, hooks } group. rulesync wrote the group for every event, which the
loader rejects before skipping the whole file. Emit the flat form, accept
both forms on import, and map canonical sessionStart to the newly documented
SessionStart event.

For mcp_config.json, stop writing the canonical `type` (Antigravity infers
the transport from command/serverUrl) and drop an empty args/env on a remote
server, which Antigravity otherwise refuses to start.

Refs #2666

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012y9fNo2AAJdGocxvsHtDhv
… refusal

Address review notes: list SessionStart among the flat events in the
feature-research reference, reword the hooks location note, mark the
remote-server refusal as observed runtime behavior, and note why a group
without hooks is dropped.

Refs #2666

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012y9fNo2AAJdGocxvsHtDhv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant