Skip to content

fix(llm-sync): correct Antigravity plugin hooks.json schema and registration - #53

Merged
tstapler merged 2 commits into
masterfrom
fix/antigravity-plugin-hooks-schema
Oct 1, 2026
Merged

tstapler merged 2 commits into
masterfrom
fix/antigravity-plugin-hooks-schema

Conversation

@tstapler

Copy link
Copy Markdown
Owner

Summary

  • Antigravity's plugin loader (jsonhook.JSONHookSpec) expects each lifecycle event to be a single {matcher, hooks} object, not Claude Code's array-of-groups schema. AntigravityPluginInstaller was writing the Claude schema verbatim, so every synced plugin with hooks (core-hooks, ponytail, prompt-injection-defender, sdd) failed to parse on every agy session start. Confirmed live against a real agy 1.2.14 session.
  • install_plugins()'s post-write agy plugin install <path> registration call always passed the exact path it had just written the plugin to as the copy source. agy refuses to copy when source and destination are the same directory (the default case), so plugins were on disk but never actually registered in agy's plugin ledger. Now stages a throwaway copy before calling agy plugin install.
  • Split _install_plugin into _install_manifest/_install_skills/_install_commands/_install_hooks while in there (kibitzer flagged the original as too long).

Test plan

  • uv run python src/targets/test_antigravity_plugin_installer.py — 5 new regression tests, all passing
  • Full existing llm-sync self-check suite re-run, no regressions
  • Verified live: hand-patched ~/.gemini/{antigravity-cli,config}/plugins/* to match the new schema and re-registered via agy plugin install — confirmed 6/6 plugin hooks.json files now parse with 0 errors on agy session start (previously 12+ parse errors per session)

Note: this does not make Antigravity actually suppress permission prompts via hooks — confirmed live via probe instrumentation that agy 1.2.14 never consults PreToolUse/PostToolUse hooks for its tool-confirmation gate at all, regardless of schema/registration correctness. That's a product gap in Antigravity itself. This PR just fixes the two real, independent bugs in our own sync tooling found along the way.

…tration

Antigravity's plugin loader (jsonhook.JSONHookSpec) expects each lifecycle
event to be a single {matcher, hooks} object, but AntigravityPluginInstaller
wrote Claude Code's array-of-groups schema verbatim — every synced plugin
with hooks (core-hooks, ponytail, prompt-injection-defender, sdd) failed to
parse on every agy session start. Confirmed live against agy 1.2.14.

Also fixed install_plugins()'s post-write `agy plugin install <path>` call,
which always passed the path it had just written to as the copy source —
agy refuses that (source == its own plugin store when target_dir is the
default), so plugins were on disk but never registered in agy's ledger.
Now stages a throwaway copy for the install call.
@tstapler
tstapler marked this pull request as ready for review September 30, 2026 08:24
@tstapler
tstapler merged commit ff8f065 into master Oct 1, 2026
6 checks passed
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