Antigravity backend - #648
Open
toanalien wants to merge 17 commits into
Open
Conversation
Add Antigravity CLI (`agy`) as a streaming chat backend (headless `agy -p --output-format stream-json`), peer of Command Code/Grok. - Backend::Antigravity enum + Deserialize + antigravity_session_id threaded through Session/SessionMetadata/RunEntry - antigravity_cli module: PATH-first detect/auth(heuristic)/models - chat/antigravity.rs: streaming stream-json parser (init/step_update/result -> chat:chunk/tool/done), conversation-id resume, one-shot magic-prompt exec - wire send dispatch, model select, resume plumbing, handoff, fork-clear - AppPreferences: selected_antigravity_model + antigravity_cli_source - is_antigravity_model (antigravity/ prefix); 8 unit tests
Add check_antigravity_cli_installed / detect_antigravity_in_path / check_antigravity_cli_auth / list_antigravity_models to dispatch_command().
- Backend/CliBackend unions + antigravity_session_id + backendOptions - AppPreferences: selected_antigravity_model + antigravity_cli_source (PATH) - AntigravityIcon + backend-label icon/label/beta cases - antigravity-cli service (status/auth/models/path) + types - useInstalledBackends detection; cli-auth status command; approval label Note: frontend not typecheck-verified in this env (no bun/node_modules); run `bun install && bun run typecheck`. Backend switches use defaults so only backend-label needed an explicit case.
…P0/P3/P4 Rust)
P0: auto_trust_workspace (~/.gemini/antigravity-cli/settings.json trustedWorkspaces),
env_remove(ANTIGRAVITY_*), --sandbox for plan mode (boolean flag).
P3: managed-install source (jean|path) in config.rs; install_antigravity_cli
(official installer script) + uninstall_antigravity_cli; dispatch arms.
P4: antigravity_cli/mcp.rs syncs Jean's managed 'jean' MCP server into
~/.gemini/config/mcp_config.json (HOME-level, per antigravity-cli coollabsio#60);
Antigravity added to thread_mcp_config merge + threaded into executor.
Ideas ported from PR coollabsio#469 (auto_trust, env_remove, managed install) onto our
stream-json engine. cargo check clean, 10 antigravity tests pass.
ANTIGRAVITY_MODEL_OPTIONS + full wiring in useToolbarDerivedState (section, resolved options, filtered arm, installedBackends default, return) so the backend/model picker shows Antigravity models. NOTE: frontend not typecheck-verified here (no bun/node_modules).
… (P2) Add antigravity to BACKEND_LABELS (mcp.ts), backendCommands + status map + BACKEND_ORDER + loading (NewSessionModeModal) so the union is exhaustive. bun run typecheck now passes (0 errors).
AntigravityPane (GeneralPane scope=antigravity): status/version, auth indicator, install/uninstall (managed). Register in PreferencesDialog nav + icon map + render; add 'antigravity' to PreferencePane union. typecheck passes (0 errors).
- OnboardingDialog: add antigravity to AIBackend/AI_BACKENDS/BETA_BACKENDS/ stepToBackend/backendLabel so it satisfies 'offers every supported backend'. - Update useInstalledBackends.test (mock antigravity-cli), PreferencesDialog.test (nav order) for the new backend. typecheck 0 errors, lint clean, 1840 tests pass (6 pre-existing GitDiffModal/MessageDiffModal failures unchanged, unrelated).
isAntigravityModel + ANTIGRAVITY_DEFAULT_MAGIC_PROMPT_BACKENDS preset; MagicPromptsPane recognizes antigravity models + effort fallback. Per-dialog model pickers still fall back to defaults (documented). typecheck 0 errors, magic/preferences tests pass.
- rustfmt applied to antigravity_cli/*, chat/antigravity.rs - clippy: doc-link formatting + conversation_id if/else (was method chain) Remaining clippy error in projects/checkpoints.rs:1503 is PRE-EXISTING (zero diff vs base, unrelated to Antigravity).
Ran agy live — found the executor was broken on real output: - stream-json discriminator is `event` (not `type`) and payload is NESTED under the event-named key → old parser matched nothing (zero streaming). Rewrote handle_line for real shape; tool input is `tool_info.parameters`, no tool id (correlate by step_index). Tests now use verbatim real lines. - Model ids were wrong (`gemini-3-pro` doesn't exist). Real defaults from `agy models`: gemini-3.6-flash-high (default), 3.1-pro-high, 3.5-flash-medium, claude-sonnet-4-6. list_antigravity_models now runs `agy models` live. - `--effort` only accepts low|medium|high → added clamp_effort. - Use native `--mode plan|accept-edits` (verified flag) + `--new-project` when no resume, instead of guessed `--sandbox` for build. - Confirmed correct: --sandbox is boolean, auth heuristic files (google_accounts.json), auto_trust trustedWorkspaces shape. cargo test 991 pass, clippy/fmt clean, typecheck 0, lint clean.
… live-run findings
Verified all 4 remaining paths against real agy 1.1.9 (no code bugs found):
- --json-schema: structured_output is TOP-LEVEL of json envelope; extracted
parse_one_shot_output helper + regression test with real envelope shape.
- resume --conversation: recall confirmed across 2 turns (PINEAPPLE test).
- MCP: ~/.gemini/config/mcp_config.json + {mcpServers} confirmed from agy's own
builtin docs — sync writes exactly this path/format.
- install URL: HTTP 200 (valid).
12 antigravity tests pass, clippy/fmt clean.
toanalien
force-pushed
the
feat/antigravity-backend
branch
from
August 4, 2026 11:24
efa0a74 to
926603a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Google Antigravity CLI (
agy) as a first-class Jean chat backend with streaming responses, tool-call rendering, conversation resume, model discovery, managed installation, settings, onboarding, and MCP integration.The implementation was validated against the real
agy1.1.9 CLI. During live testing, the stream parser, model IDs, execution flags, backend routing, and response persistence were corrected to match actual runtime behavior.What changed
Backend and execution
Backend::Antigravityand persistsantigravity_session_idacross sessions and runs.agyin headless streaming mode with--output-format stream-json.agyevents (init,step_update, andresult) for incremental text, tool calls, usage, and conversation IDs.--conversation <id>.--mode plan/--mode accept-edits).antigravity/prefix before invokingagy.agy:low,medium, andhigh.CLI integration
agyfrom PATH and supports Jean-managed installation/uninstallation.agy modelswith tested fallback models.ANTIGRAVITY_*environment variables before spawning the CLI.~/.gemini/config/mcp_config.json.UI and preferences
Runtime verification
Verified locally with
agy1.1.9:stream-jsontext events are rendered incrementally.gemini-3.6-flash-highand other IDs returned byagy modelsare accepted.--json-schemareturns top-levelstructured_outputfor one-shot operations.Validation
bun run typecheckbun run lintcargo check --manifest-path jean-core/Cargo.tomlcargo check --manifest-path src-tauri/Cargo.toml --no-default-featuresagyoutputagybinaryHow to test
terminal 1
terminal 2
Screenshots