Repository navigation
feat(antigravity): add Antigravity CLI over native ACP - #12
Merged
Merged
Conversation
Add Antigravity CLI (`agy acp`) as a built-in Subturn harness so callers can spawn and resume Antigravity models through the same five-tool surface without learning its flags, auth layout, or config options. - `src/plugins/antigravity.ts`: `antigravity` plugin discovering `agy`, applying `model` then `thought_level` via `session/set_config_option` on every turn, isolating session state under `--gemini-dir` / `GEMINI_HOME`, copying file-based OAuth tokens privately (0600, reconciled on resume so refreshes stay in the shadow and account/method switches clear stale state), and falling back to ACP `authenticate` (`gemini-api-key`) when `GEMINI_API_KEY` is set. - `src/core/acp-turn.ts`: optional `authMethodId` for ACP `authenticate`, treat `stopReason=refusal` as a failed turn, and emit an `exit` event on clean child shutdown. - `src/plugins/acp-models-probe.ts`: prefer deduplicated `configOptions[id="model"]` values (including grouped select options) over legacy `models.availableModels`, check `protocolVersion === 1`, and support optional `authMethodId`. - `src/faces/cli.ts`: size the `status` name column dynamically so longer harness names stay aligned. - `test/antigravity.test.ts`, `test/live.test.ts`, `README.md`, `package.json`: offline tests against a stateful fake `agy`, cheap live bundle entry, and docs. Model and harness: Gemini 4 Neon (High) in Antigravity.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Subturn had no plugin for the Antigravity CLI (
agy), so orchestrators couldn't spawn or resume Antigravity models through the same five-tool surface without dealing with its ACP flags, auth layouts, and config options directly.What changed
src/plugins/antigravity.ts&src/plugins/index.ts: adds theantigravityplugin over native ACP (agy acp), discovering onlyagy(never the IDE'santigravitybinary).modelthenthought_levelviasession/set_config_optionon both fresh and resumed (session/load) turns, emitting per-config evidence (set_config_result/set_config_error) and writingack.json. Models without athought_leveloption fail loudly with-32602rather than silently skipping effort.--gemini-dir+--app-data-dir antigravity-cli+GEMINI_HOME, with--dangerously-skip-permissions,--disable-telemetry,--include-default-customizations=false, andAGY_CLI_DISABLE_AUTO_UPDATE=1.GEMINI_API_KEY(via ACPauthenticate), file-based OAuth tokens (antigravity-oauth-token/ legacyacp_token.json) copied privately at0600(not symlinked, soagy's in-place token refreshes never mutate the user's profile) and reconciled on resume so refreshed shadow tokens are preserved while profile/method switches clear stale files andcache/acp-auth-state.json, or desktop OS keyring.src/core/acp-turn.ts: optionalauthMethodIdfor ACPauthenticate, fail turns onstopReason === "refusal"alongsidecancelled, and emit anexitevent on clean child shutdown.src/plugins/acp-models-probe.ts: prefer deduplicatedconfigOptions[id="model"]values (including grouped select options) over legacy suffixedmodels.availableModels, checkprotocolVersion === 1, and support optionalauthMethodId.src/faces/cli.ts: compute thestatusname-column width from registered plugin names soantigravitystays aligned.test/antigravity.test.ts,test/live.test.ts,README.md,package.json: offline test suite against a stateful fakeagy, cheap live bundle (gemini-3.8-flash/low), and docs.Verification
npm run typecheck,npm test(40 pass, 3 live skipped),npm run build.dist/faces/cli.js status(against a scratchSUBTURN_STATE_DIR) in both file-token and desktop-keyring environments, plus built MCPdist/faces/mcp.jsstdio handshake.agy 1.5.14(7 tiny turns ongemini-3.8-flash, scratchSUBTURN_STATE_DIR): verifiedlow+resume(modelId=1320,Gemini 3.8 Flash (Low)ingen_metadataon both turns, zero trace in~/.gemini/antigravity-cli),high(modelId=1318,Gemini 3.8 Flash (High)), legacy suffixed ID override, and pre-prompt-32602rejections for unsupportedthought_level.Model and harness: Gemini 4 Neon (High) in Antigravity.