Skip to content

feat: add Antigravity CLI harness with Google OAuth - #190

Merged
Desperado merged 2 commits into
mainfrom
Desperado/antigravity-harness-qmax
Sep 7, 2026
Merged

feat: add Antigravity CLI harness with Google OAuth#190
Desperado merged 2 commits into
mainfrom
Desperado/antigravity-harness-qmax

Conversation

@Desperado

Copy link
Copy Markdown
Contributor

Summary

  • Add Antigravity (agy) as a fourth /orch CLI backend alongside Claude Code, Codex, and OpenCode.
  • Sign-in is Google OAuth via interactive agy (agy 1.1.27 has no auth subcommand). MCP is merged into ~/.gemini/config/mcp_config.json; skills go to ~/.gemini/antigravity-cli/skills/.
  • Surfaces: /agy, /orch Antigravity section, --backend agy, and qmax-code config set backend agy.

Test plan

  • Install Antigravity CLI (agy 1.1.27+) and confirm agy is on PATH or in ~/.local/bin.
  • Run agy interactively, complete Google OAuth, then /exit back to the shell.
  • In qmax-code, run /agy (or ./qmax-code --local --backend agy) and confirm MCP/skills install plus backend activation.
  • Send a turn that writes a file in cwd; confirm stream-json output and that a follow-up turn resumes the same conversation.
  • Confirm agy auth login is not invoked anywhere in the login path.
  • /clear starts a new conversation; switching away from Antigravity and back still works.

Made with Cursor

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>
@qualitymaxapp

qualitymaxapp Bot commented Sep 7, 2026

Copy link
Copy Markdown

QualityMax Review

Reviewing 37a560734b77 now.

Max's current mission: Max is skateboarding through the review queue.

 /\_/\
( ^.^ )
 /| |\
(_| |_)________
  O----------O

The completed review will replace this message.

@qualitymaxapp qualitymaxapp Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QualityMax Review — canonical overview updated; inline findings are attached to this review.

@qualitymaxapp

qualitymaxapp Bot commented Sep 7, 2026

Copy link
Copy Markdown

⚠️ QualityMax Pipeline

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 AgyAgent subprocess 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.

Comment thread internal/setup/agy.go
Comment on lines +13 to +30

// 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
}

Comment on lines +481 to +491
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()
}
}
Comment thread internal/setup/consent.go
Comment on lines +36 to +39
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>
@Desperado
Desperado merged commit 884d6c8 into main Sep 7, 2026
4 of 5 checks passed
@Desperado
Desperado deleted the Desperado/antigravity-harness-qmax branch September 7, 2026 21:46
@Desperado Desperado mentioned this pull request Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants