feat: add Antigravity CLI harness with Google OAuth - #190
Conversation
Wire agy as a fourth /orch backend using interactive Google sign-in, MCP merge into ~/.gemini/config, and print-mode stream-json turns. Co-authored-by: Cursor <cursoragent@cursor.com>
QualityMax ReviewReviewing Max's current mission: Max is skateboarding through the review queue. The completed review will replace this message. |
|
| Gate | Result |
|---|---|
| 🔍 AI diff review | ✅ Clean · gemini-3.1-flash-lite · completed · 25 eligible / 25 reviewed · gemini-3.1-flash-lite |
| 🔍 SAST | completed · 33 eligible / 33 reviewed · qwen3.7-plus |
| 🔍 Canonical PR review delivery | completed · 0 eligible / 0 reviewed · exact-head review #5135095546 and overview #5575335995 confirmed |
| 🧪 Repo Tests | ✅ 767/767 passed (go) |
Powered by QualityMax — AI-Powered Test Automation
There was a problem hiding this comment.
🟡 Changes recommended
There are a few user-facing issues in the new agy integration (consent UI command labeling, repeated OAuth prompting, and inconsistent tool-name rendering) that should be corrected before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds Antigravity CLI (agy) as a first-class orchestration backend in qmax-code, including MCP/skills installation wiring and TUI/REPL surfaces so users can run the Antigravity harness under Google OAuth without a Gemini API key.
Changes:
- Introduces
AgyAgentsubprocess harness (agy --output-format stream-json) with conversation resume and MCP config merging into~/.gemini/config/mcp_config.json. - Adds
/agy,--backend agy, model picker entries, and config validation/support across main, REPL, and TUI. - Extends docs/security/changelog/contributing guidance to cover Antigravity OAuth, MCP path, and skills installation location.
File summaries
| File | Description |
|---|---|
| SECURITY.md | Documents Antigravity MCP config path and OAuth behavior. |
| receipt.go | Adds agy receipt kind mapping. |
| README.md | Updates product docs and command table to include /agy and Antigravity backend. |
| main.go | Adds agy backend flag handling, activation flow, and backend initialization. |
| main_models.go | Handles model selection persistence for agy via ModelOverride. |
| main_models_test.go | Adds coverage for agy model-selection behavior. |
| internal/tui/tui_backend.go | Adds Antigravity section, models, and installed-state wiring to the picker UI. |
| internal/tui/tui_backend_cerebras_test.go | Updates picker constructor signature in existing tests. |
| internal/tui/tui_backend_cc_test.go | Updates picker constructor signature in existing tests. |
| internal/tui/tui_backend_agy_test.go | New tests asserting Antigravity picker entries and default cursor. |
| internal/tui/terminal.go | Adds banner line describing Antigravity backend and OAuth/no-key status. |
| internal/tui/input.go | Adds /agy to slash menu. |
| internal/skills/materialize.go | Adds BackendAgy and skills dir mapping under ~/.gemini/antigravity-cli/skills. |
| internal/skills/materialize_test.go | Adds tests for agy skill materialization/frontmatter behavior. |
| internal/setup/orch.go | Adds InstallAgy, enables skills install/status for agy, and detects agy MCP install state. |
| internal/setup/orch_test.go | Adds test verifying InstallAgy writes/flags the MCP config. |
| internal/setup/consent.go | Extends consent flow to include Antigravity backend and MCP path. |
| internal/setup/consent_test.go | Ensures permission-mode selection applies to agy. |
| internal/setup/agy.go | Adds interactive Google OAuth prompt launcher (agy) during activation. |
| internal/repl/repl.go | Adds live backend switching to/from agy, picker wiring, and MCP reconnect support. |
| internal/repl/planwindow_turn_test.go | Includes agy in plan-window key tests. |
| internal/api/context.go | Updates session context backend comment to include agy/opencode. |
| internal/api/config.go | Documents agy backend semantics and permission-mode applicability. |
| internal/agent/agy_agent.go | New Antigravity subprocess harness, MCP writer, NDJSON parser, and conversation resume. |
| internal/agent/agy_agent_test.go | New tests for MCP merge, arg building, parsing, and error messaging. |
| docs/ORCHESTRATION.md | Adds Antigravity backend docs including OAuth flow and MCP install behavior. |
| docs/COMMANDS.md | Documents --backend agy and /agy and plan-window inclusion. |
| CONTRIBUTING.md | Updates contributor setup notes to mention Antigravity CLI as a dev backend option. |
| config_command.go | Adds config print and backend validation support for agy. |
| config_command_test.go | Adds backend validation coverage for agy. |
| CLAUDE.md | Updates repo positioning docs to include Antigravity as an orchestration backend. |
| CHANGELOG.md | Adds unreleased entry describing new Antigravity backend behavior. |
| AGENTS.md | Updates agent instructions/positioning to include Antigravity OAuth and CLI role. |
Review details
- Files reviewed: 33/33 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| // PromptAgyGoogleLogin offers to launch Antigravity's Google OAuth flow. | ||
| // agy 1.1.x has no `auth login` subcommand: Google sign-in runs when the | ||
| // interactive CLI starts with no cached token. An AI Studio API key is not | ||
| // required. Skipped when stdin is not a TTY, or when a file-backed OAuth | ||
| // token is already present. | ||
| func PromptAgyGoogleLogin(agyBin string) { | ||
| if agyBin == "" { | ||
| return | ||
| } | ||
| if agent.AgyFileTokenPresent() { | ||
| return | ||
| } | ||
| if !term.IsTerminal(int(os.Stdin.Fd())) { | ||
| fmt.Println(" Sign in with Google first: run `agy`, complete the browser login, then exit.") | ||
| return | ||
| } | ||
|
|
| if su.State == "DONE" && term != nil { | ||
| if a.outputVerbose && su.ToolInfo != nil { | ||
| out := su.ToolInfo.Output | ||
| if su.ToolInfo.Error != nil && su.ToolInfo.Error.Message != "" { | ||
| out = su.ToolInfo.Error.Message | ||
| } | ||
| term.PrintToolResult(stripMCPPrefix(su.ToolName), tui.TruncateStr(out, 200)) | ||
| } else { | ||
| term.StartThinking() | ||
| } | ||
| } |
| if backend == "agy" { | ||
| cliName = "Antigravity" | ||
| globalConfigPath = "~/.gemini/config/mcp_config.json" | ||
| } |
Skip the Google login prompt after the first offer in a process, keep ACTIVE/DONE tool labels aligned, and show `agy` in consent copy. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
agy) as a fourth/orchCLI backend alongside Claude Code, Codex, and OpenCode.agy(agy 1.1.27 has noauthsubcommand). MCP is merged into~/.gemini/config/mcp_config.json; skills go to~/.gemini/antigravity-cli/skills/./agy,/orchAntigravity section,--backend agy, andqmax-code config set backend agy.Test plan
agy1.1.27+) and confirmagyis on PATH or in~/.local/bin.agyinteractively, complete Google OAuth, then/exitback to the shell./agy(or./qmax-code --local --backend agy) and confirm MCP/skills install plus backend activation.agy auth loginis not invoked anywhere in the login path./clearstarts a new conversation; switching away from Antigravity and back still works.Made with Cursor