feat(provider): add Antigravity (Google AGY) provider integration & ACP bridge
Summary
Adds full support for the Google Antigravity (agy) provider into T3 Code.
Antigravity has no native agent protocol, so this integration introduces an ACP compatibility bridge process (t3 agy-acp) that wraps agy --print mode while reconstructing live event streams from PreToolUse/PostToolUse/Stop hooks and trajectory transcripts (transcript.jsonl).
[!NOTE] Credit & Reference: This PR incorporates and builds upon the foundational ACP bridge architecture originally submitted by @agentool in #4497. It extends that work with dynamic UI model grouping, log-based account/subscription discovery, official vector SVG branding, non-interactive text-generation shortcuts, and full unit test coverage across all provider layers.
📸 Screenshots & UI Showcase
1. Model Discovery & Reasoning Effort Selector
Groups raw CLI slugs (gemini-3.6-flash-high, gemini-3.6-flash-medium, etc.) into clean base models with dynamic Reasoning Effort (Low / Medium / High) selectors.
2. Provider Settings & Account Authentication
Automatically parses CLI logs to display the authenticated user's email address and subscription tier badge (Google AI Pro Subscription / Enterprise).
3. Agent Conversation & Clean UI Footer
Renders structured response streaming, markdown formatting, and clean provider footer (with mode selector dropdown hidden via showInteractionModeToggle: false).
🛠️ What Changed & Why
1. UI Model Grouping (AntigravityProvider.ts)
- Problem:
agy modelsreturns 11 raw, un-grouped slugs (e.g.gemini-3.6-flash-high,gemini-3.6-flash-medium,gemini-3.6-flash-low), cluttering the model picker dropdown. - Solution: Implemented
groupAntigravityModels()to consolidate slugs under clean base models (Gemini 3.6 Flash) with a dynamic Reasoning Effort Selector (Low,Medium,High).
2. Account & Subscription Discovery (AntigravityProvider.ts)
- Implemented
checkAntigravityAccountAuth()to inspect.gemini/antigravity-cli/cli.logandonboarding.json, displaying the logged-in email and subscription badge (Google AI Pro Subscription,Enterprise, etc.).
3. Tool Execution & Live Event Stream (agyBridge.ts & AntigravityAdapter.ts)
- Executes turns via
agy --printmode using--dangerously-skip-permissions. - Reconstructs a real-time event stream by correlating
PreToolUse/PostToolUse/Stophooks with transcript JSONL records onstepIdx/step_index. - Sets
showInteractionModeToggle: falseso that unnecessary permission mode selectors (Full access / Supervised) are automatically hidden from the UI for Antigravity sessions.
4. Official Vector SVG Branding & Preview Badge (Icons.tsx & providerDriverMeta.ts)
- Replaced fuzzy PNG icon with high-resolution vector SVG paths and gradient masks.
- Updated provider badge label to "Preview".
5. File Attachments (attachmentStore.ts & AntigravityAdapter.ts)
- Added
attachmentFileUrl()usingNodeURL.pathToFileURL()to safely URI-encode file paths across operating systems. - Attached files are converted to
resource_linkURIs, appended to the prompt, and granted directory access viaagy --add-dir.
6. In-Session Model Switching (sessionModelSwitch: "in-session")
- Because
--modelis a per-turn flag onagy --print --conversation <id>, model changes take effect on subsequent turns while preserving the conversation trajectory.
7. Process Concurrency & Error Resiliency
- Uses isolated per-session state files (
t3code-acp-sessions/<sessionId>.json) to avoid race conditions when running multiple subagents/threads concurrently. - Queue error catching returns explicit JSON-RPC error responses (
-32603), preventing UI client hangups if an internal bridge error occurs.
✅ Checklist
- [x] Code follows repository standards and TypeScript Effect conventions.
- [x] Formatting ran cleanly via
vp fmt. - [x] All 61 unit tests pass locally.
- [x] Credited prior work in #4497 by @agentool.
- [x] Includes documentation in
AGENTS.md.
[!NOTE]
Add Antigravity (Google AGY) provider integration with ACP bridge
- Introduces a full Antigravity provider driver (
ProviderDriverKind: 'antigravity') that spawns theagyCLI as a subprocess, discovers models viaagy models, and checks authentication from local CLI artifacts.- Adds an ACP stdio bridge (agyBridge.ts) that translates Antigravity hook events (
pre-tool-use,post-tool-use,stop) and live transcript JSONL into ACP session updates including tool call lifecycle, diffs, and streamed assistant text.- Registers
agy-acpandagy-hookas hidden CLI subcommands in the server binary, enabling the bridge and hook handler to be invoked as child processes.- Adds an Antigravity-backed
TextGenerationservice covering commit messages, PR content, branch names, and thread titles, with a 180s timeout and schema-validated JSON extraction from streamed output.- Extends contracts, settings schemas, and the web provider picker to include Antigravity with an inline SVG icon and an 'Experimental' badge.
- Risk: Antigravity sessions do not support images, session modes, or per-turn stdin; tool approval defaults to required and model changes only apply on the next turn.
Macroscope summarized 76f12ef.
[!NOTE] High Risk Large new subprocess and JSON-RPC bridge surface runs
agywith skipped CLI permissions and optional hook-based tool gating; mistakes in approval, attachment staging, or transcript parsing can affect repo access and session correctness.Overview Adds Antigravity as a first-class built-in provider for the Google
agyCLI, which has no native agent protocol. Sessions talk to a bundled ACP stdio bridge (t3 agy-acp) that runs each turn viaagy --printand rebuilds live updates by correlating PreToolUse / PostToolUse / Stop hooks withtranscript.jsonlrecords onstepIdx/step_index.The server registers
AntigravityDriverinbuiltInDrivers, wiresAntigravityAdapter(sessions, steers, cancel epochs, optional PreToolUse approval whenrequireToolApprovalis on),AntigravityProvider(agy --version/agy modelswithstdin: "ignore", grouped reasoning tiers, auth hints from local CLI logs), andAntigravityTextGenerationfor commit/PR/branch/title helpers. Hidden CLI subcommandsagy-acpandagy-hookship in the server binary;attachmentFileUrlturns stored attachments into safefile:URIs forresource_linkprompts and per-turn staging in the bridge.
AGENTS.mddocuments bridge behavior and print-mode limits (no images/session modes; model binding per spawn). Provider rollback is explicitly unsupported; in-session model switches apply on the next turn via--model+--conversation.Reviewed by Cursor Bugbot for commit 76f12ef7e0ea30fa127a8b306a9cca2c908a318d. Bugbot is set up for automated code reviews on this repo. Configure here.
[!IMPORTANT]
Review skipped
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
ece840ca-0d5e-4ac5-83ce-92771fcb6894You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
- [ ] 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
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 @coderabbitai help to get the list of available commands.
Approvability
Verdict: Needs human review
2 blocking correctness issues found. Diff is too large for automated approval analysis. A human reviewer should evaluate this PR.
You can customize Macroscope's approvability policy. Learn more.
I have been using this for an hour with no issues so far.
@umarfaruq0z why did you close it?