feat(adapters): add Antigravity CLI (agy) adapter profile#67
Conversation
Google's `agy` joins claude/codex/gemini/copilot as a driven CLI. It reuses the auto-discovered profile system; the only new logic is a hook dialect (`antigravity-hooks-json`) because agy keys `.agents/hooks.json` by a top-level hook-name group and stores a flat `Stop` handler list (no matcher/hooks wrapper), with second-based timeouts. Only the `Stop` turn-end event is registered — agy fires no SessionStart/SessionEnd hooks. Token accounting ships as `usage_parser = "none"`; a parser is deferred until a live transcript.jsonl schema is captured. Flags/paths verified against agy v1.0.16; marked experimental/probe-required pending an end-to-end smoke. Closes bmad-code-org#66
The idempotency check in merge_hooks used `HOOK_MARKER in handler.get("command", "")`,
which raises TypeError when a pre-existing hook entry carries a non-string command
(e.g. an explicit null). The default only applies to an absent key, not a present
None. Guard both dedupe walks with an isinstance check so a slightly malformed
hooks.json no longer crashes `init`. Pre-existing across all dialects; surfaced by
the new antigravity branch, fixed at the shared site too.
|
Warning Review limit reached
Next review available in: 48 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
WalkthroughThis PR adds support for Google's Antigravity CLI ( ChangesAntigravity adapter support
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Installer as install.py
participant HookEntry as _hook_entry
participant Merge as merge_hooks
participant Config as hooks.json
Installer->>HookEntry: build handler for antigravity-hooks-json
HookEntry-->>Installer: agy-shaped handler object
Installer->>Merge: merge registrations for Stop event
Merge->>Config: write under ANTIGRAVITY_HOOK_GROUP
Merge-->>Installer: preserve other groups, dedupe by command marker
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🤖 Augment PR SummarySummary: Adds an experimental 🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/setup-guide.md`:
- Around line 93-95: Update the setup-guide text to match the expanded adapter
list so the prompts no longer contradict the supported options. In the relevant
setup prompt sections, make sure the wording and any examples reference the full
set of adapters used by the setup flow, including antigravity, and keep the same
list consistent wherever the adapter choices are described so users aren’t told
only claude, codex, and gemini are valid.
In `@src/bmad_loop/data/skills/bmad-loop-setup/SKILL.md`:
- Around line 135-137: Update the onboarding prompt in SKILL.md to match the
rest of the setup instructions by making the supported coding CLI list
consistent everywhere; the prompt near the CLI selection section should align
with the later validation text and any other references in this skill. Use the
existing CLI-selection wording and symbols in the setup flow to locate it, and
ensure the accepted names are reconciled so `/bmad-loop-setup` does not present
conflicting options.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 08d83263-e8ad-4a75-833e-a1d81ee90fd4
📒 Files selected for processing (11)
README.mddocs/FEATURES.mddocs/adapter-authoring-guide.mddocs/setup-guide.mdsrc/bmad_loop/adapters/profile.pysrc/bmad_loop/cli.pysrc/bmad_loop/data/profiles/antigravity.tomlsrc/bmad_loop/data/skills/bmad-loop-setup/SKILL.mdsrc/bmad_loop/install.pytests/test_install.pytests/test_probe.py
- install.py: raise a clear ProfileError when a pre-existing .agents/hooks.json has a non-table `bmad-loop` group or a non-list event value, instead of an opaque AttributeError during init (augment) - cli.py: list `copilot` in the `init --cli` help (was omitted) - setup-guide.md / bmad-loop-setup SKILL.md: reconcile the "valid names" notes with the full profile set (copilot + antigravity); mark antigravity experimental in the choose-CLIs section (augment, coderabbit) - README.md: prettier table re-alignment (the widened antigravity row) - test: malformed-shape hooks.json now asserts a clear ProfileError
|
Addressed review + fixed the prettier CI failure in
Not changed: the |
pbean
left a comment
There was a problem hiding this comment.
Validated end-to-end — approving. ✅
Safe for the core and the other adapters. All new write-logic is gated behind if dialect == "antigravity-hooks-json" and returns early; the claude/codex/gemini/copilot paths are untouched except the one hardening line in merge_hooks, which is behaviour-preserving for every valid config (identical result for string commands, only stops a TypeError on a null one). No OS-seam edits — agy isn't claude-settings-json, so the hook command bakes its absolute path through the existing ProcessHost.hook_interpreter()/shell_quote() seam, exactly like codex/gemini/copilot, so it's portable with zero new platform code. Profile-name enumeration is fully dynamic (load_profiles()), so the new TOML registers everywhere automatically — nothing hardcoded was missed.
merge_hooks branch is correct: idempotent (the dedupe walk tolerates both flat and wrapped shapes), raises a clear ProfileError on a malformed pre-existing group/event, and preserves other user/plugin hook groups. Test coverage is thorough.
External agy facts verified against live sources (Antigravity CLI post-dates my usual references, so I checked each): binary agy, -i = --prompt-interactive, --dangerously-skip-permissions, project hooks in .agents/hooks.json keyed by a top-level named group, second-based timeouts, skills in .agents/skills/, and agy 1.0.16 all check out. The load-bearing one — that Stop is a flat handler with no matcher/hooks wrapper (what _hook_entry writes) — is confirmed: agy treats Stop/PreInvocation/PostInvocation as matcher-less flat lists, unlike the wrapped PreToolUse/PostToolUse shape. So the profile is right.
The experimental — probe-required labeling correctly fences the one thing not verifiable from a code read (live Stop firing under the multiplexer + worktree-trust re-prompt), which you've runtime-checked against real agy 1.0.16 and gated behind probe-adapter antigravity.
Replied separately on the two items you flagged for me. Nice, tidy addition.
|
On the two you tagged me about — both fine to leave as-is here:
I'll pick up that |
…d agy probe glob (#70) * fix(install): guard strip_legacy_hooks against a non-string command A pre-existing hook handler whose `command` is present-but-null crashed strip_legacy_hooks with `TypeError: argument of type 'NoneType' is not iterable` at both dedupe walks (the flat copilot entry and the nested claude/codex/gemini handler). Mirror the isinstance-str guard PR #67 landed in merge_hooks so a malformed hand-edited config is tolerated (a non-string command simply isn't a bmad_auto hook, so it's kept). Regression test covers both walks. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat(probe): add antigravity transcript family glob for agy discovery Give `probe-adapter antigravity` a fallback transcript location so it can auto-discover an agy conversation transcript.jsonl — the step that unblocks writing the deferred token parser (the antigravity profile ships usage_parser = "none"). The path is community-doc-sourced (agy 1.0.x) and degrades safely to the existing "no convention" note if wrong; confirm against a live build with `probe-adapter antigravity --probe`. Companion to #67 — the glob activates once the antigravity profile lands.
What
Adds an
antigravityadapter profile so the orchestrator can drive Google's Antigravity CLI (agy) alongsideclaude/codex/gemini/copilot.Profiles are auto-discovered, so the only new logic is a hook dialect. agy keys
.agents/hooks.jsonby a top-level hook-name group and stores a flatStophandler list (nomatcher/hookswrapper), with second-based timeouts — different enough from the existing dialects to need its ownantigravity-hooks-jsonbranch. Only theStopturn-end event is registered; agy fires no SessionStart/SessionEnd hooks.Details
antigravity.toml—-iinteractive launch,--dangerously-skip-permissions,--model, skills in.agents/skills, hooks in.agents/hooks.json.antigravity-hooks-jsondialect —merge_hooks/_hook_entrywrite the flat handler under abmad-loopgroup; idempotent and preserves any user/plugin hook groups.usage_parser = "none"; agy conversations are binary SQLite and the per-workspacetranscript.jsonlschema isn't captured yet. A parser follows once a live transcript exists.agyv1.0.16 and its shipped docs, but end-to-end behavior (Stop under the multiplexer, worktree trust) still needs a live smoke viaprobe-adapter antigravity.Second commit is a standalone robustness fix: the
merge_hooksidempotency check crashed withTypeErrorif a pre-existing hook entry carried a non-stringcommand(present-but-null). Guarded at both dedupe walks — pre-existing across all dialects, surfaced by the new branch.Tests
New
merge_hookscases for the antigravity shape (entry shape, idempotency, append-beside-existing, preserve-other-groups, non-string command);probeparametrize extended.ruff checkclean; full suite green.init --cli antigravityandprobe-adapter antigravityruntime-verified against realagyv1.0.16.Closes #66
Summary by CodeRabbit
New Features
Documentation