Skip to content

feat(agy): add Antigravity (agy) as third LLM provider#277

Merged
kumaakh merged 34 commits into
mainfrom
feat/agy-support
May 28, 2026
Merged

feat(agy): add Antigravity (agy) as third LLM provider#277
kumaakh merged 34 commits into
mainfrom
feat/agy-support

Conversation

@kumaakh
Copy link
Copy Markdown
Contributor

@kumaakh kumaakh commented May 27, 2026

Summary

  • Adds Antigravity (agy) as a third LLM provider alongside claude and gemini -- new provider adapter, install path, asset scripts, AGY.md instruction file, and curated tier-to-model mapping.
  • Validated end-to-end via e2e s8.1 (Windows runner, agy PM + agy doer + agy reviewer): the PM drives a real doer-reviewer cycle, opens a toy PR, and the reviewer approves. Latest green run: https://github.com/Apra-Labs/apra-fleet/actions/runs/26525621742
  • Includes a small refactor that ships agy helper scripts (transcript-reader, settings-merge) as standalone .js asset files via the existing SEA bundling pipeline -- eliminates a Windows shell-quoting class of bug in inline node -e '<script>' invocations.

Notable changes

  • New provider adapter (src/providers/agy.ts) with ANTIGRAVITY_API_KEY auth, AGY.md instruction file, and tier mapping (cheap=Gemini 3.5 Flash Medium, standard=Gemini 3.1 Pro Low, premium=Claude Opus 4.6 Thinking).
  • Asset-shipped helper scripts (scripts/agy-transcript-reader.js, scripts/agy-settings-merge.js) bundled via gen-sea-config.mjs and installed to ~/.apra-fleet/scripts/ -- no more inline node -e with quoted JS literals.
  • Per-workspace settings.json override written before each agy dispatch (both unix buildPromptCommand and Windows wrapWindowsPrompt paths) to honor tier hints without mutating global config.
  • Workspace overlay scaffolding for local agy members (writeAgyWorkspaceOverlays writes empty .ignore files for apra-fleet MCP + pm/fleet skills) -- see Known Limitations below.
  • New e2e suites s8.1/s8.2/s8.3 in .github/workflows/fleet-e2e.yml.
  • 52 files changed, +1280 / -254.

Known limitations (tracked in beads)

  • nx4 (P0): workspace .ignore overlay does NOT actually block apra-fleet MCP at runtime -- agy ignores it for mcp_config.json-registered servers. .ignore files land on disk; agy still permits the calls. Doesn't break sprints, but local agy doer/reviewer can still reach fleet tools. Needs research on --mcp-config PATH or per-workspace mcp_config.json overrides.
  • 0bj (P2): PM never asks reviewer to review plan.md before sprint execution -- reviewer only sees the plan bundled in the final code review. May be a pm-skill spec gap or an agy PM behavior gap; needs investigation.
  • 4ra (P1): no agy-specific cases yet in tests/install-multi-provider.test.ts.
  • zd4 (P2): large inline scripts still embedded in fleet-e2e.yml lines 310 and 383 -- separate chore PR.
  • cai (P3): agy transcripts don't record model identity, so verifying M6 end-to-end at runtime requires an out-of-band signal (API logs, in-prompt echo, etc.).
  • 941 (P3): derive provider-metadata unset list from registry instead of hardcoded arrays.

Test plan

  • npm test -- 1298 passing, 6 skipped, 0 failures
  • npm run build (tsc) clean
  • npm run build:binary produces working SEA installer on Windows
  • e2e s8.1 passed twice on this branch (runs 26320347003 and 26525621742) -- agy PM successfully orchestrates doer-reviewer cycle, raises PR, reviewer approves
  • M6 runtime verified on fleet-e2e-win: <workspace>/.gemini/antigravity-cli/settings.json contains the mapped model display name per dispatch (doer = Gemini 3.1 Pro (Low), reviewer = Claude Opus 4.6 (Thinking))
  • H4 overlay files land on disk in each member workspace (functional verification of write logic; runtime blocking effect is the nx4 follow-up)
  • Future: re-run e2e s8.2 and s8.3 (linux/macos agy variants) before considering agy GA

Azure Pipeline and others added 30 commits May 21, 2026 11:06
…-mode keep-alive rules and E2E timeout settings
- Add --output-format stream-json to agy PM invocations (setup + sprint)
  so raw-setup.txt and raw-sprint.txt are populated instead of empty.
  Previously agy wrote nothing to stdout when output was redirected to
  a file because no JSON streaming flag was set.

- Fix Seed PM permissions to write agy settings to ~/.gemini/antigravity-cli/
  (home dir) instead of \/.gemini/antigravity-cli/. agy resolves
  settings from the home directory, not the working directory, so the
  seeded allow-list was silently ignored on every s8.x run.

- Replace extract-results.mjs agy stub (which hardcoded tokens=0 and
  returned the raw file as opaque text) with proper JSONL parsing
  matching the gemini schema. agy emits the same stream-json event types
  (type:message, type:result with stats), so CHECKPOINTs and token
  telemetry are now correctly extracted.

- Fix session ID grep to also match type:init (emitted by gemini/agy)
  in addition to type:system (emitted by claude), so session IDs are
  captured for all providers.

- Improve error-diagnosis greps in both phases: fall back to tail -1
  when no type:result/type:final line exists (happens for agy in
  plain-text fallback mode), and pipe jq through || echo so non-JSON
  last lines are still surfaced in the log.
Bundles 10 fixes from the agy-support code review (severity-ordered):

- B1 (blocker): escape sessionId in Windows prompt wrapper (agy.ts:213)
- B2 (blocker): use ANTIGRAVITY_API_KEY instead of shared GEMINI_API_KEY (auth.ts:11)
- H1 (high):    list AGY.md as distinct context file in SKILL.md (skills/fleet/SKILL.md:250)
- H2 (high):    preserve user's custom defaultModel on reinstall (install.ts:284-287)
- M2 (medium):  warn when transcript parsing falls back to raw output (agy.ts:89-118)
- M3 (medium):  deduplicate requiredPerms entries (install.ts:220-230)
- M4 (medium):  write agy hooks.json with 0o600 permissions (install.ts:209)
- L2 (low):     mention agy in llms.txt subtitle
- L3 (low):     add agy setup note covering OAuth + ANTIGRAVITY_API_KEY (docs/install.md)
- L4 (low):     label agy-safety-rationalization.md as internal

Test results: 1298 passed, 6 skipped, 0 failures. Typecheck clean.
Deferred to follow-up beads issues: H3, H4, M1, M5, M6, N1.
NODE_TRANSCRIPT_SCRIPT is embedded in a shell command as
`node -e '<script>'`. The embedded `||''` terminated the outer
single-quoted shell string, mangling the JS that reached Node and
causing SyntaxError on every agy execute_prompt invocation.

Switch to `||""` so the empty-string literal survives shell quoting.
…aces (cyp)

Local agy members share the user's ~/.gemini/antigravity-cli/ directory
with the PM and other tools, so the apra-fleet MCP and PM/fleet skills
load unnecessarily inside member workspaces.

Use Antigravity's per-workspace .ignore overlay mechanism: dropping
empty .ignore files at .gemini/antigravity-cli/mcp/<name>/.ignore (or
skills/<name>/.ignore) blocks that global entry in the workspace only.

Closes apra-fleet-projects-cyp.
agy has no --model CLI flag in -p mode, so fleet previously silently
ignored cheap/standard/premium tier hints. Antigravity supports a
workspace-level settings.json that overrides the global default model;
fleet now writes this file (merge-preserving the user's other fields)
on each dispatch with a mapped display name.

Mapping:
  cheap    -> Gemini 3.5 Flash (Medium)
  standard -> Gemini 3.1 Pro (Low)
  premium  -> Claude Opus 4.6 (Thinking)

Updates the M2 raw-fallback warning if it referenced ignored tiers.

Closes apra-fleet-projects-1st.
Akhil Kumar and others added 4 commits May 27, 2026 02:01
…55c, M1)

Stop embedding the agy transcript-reader and per-dispatch settings-merge
scripts inline via `node -e '<literal>'`. PowerShell + Windows CreateProcess
mangle the inner quote characters in transit, causing SyntaxError on every
agy execute_prompt on Windows.

Move both script bodies to scripts/agy-*.js, ship to
~/.apra-fleet/scripts/ at install time, and invoke via `node "<path>"`.
No shell quoting involved; scripts now readable, debuggable, and testable
independently.

Closes apra-fleet-projects-55c.
Closes apra-fleet-projects-i73 (M1).
The Windows code path (wrapWindowsPrompt) was missing the call to
agy-settings-merge.js that buildPromptCommand makes, so per-workspace
settings.json never got the `model` field on Windows. Verified via e2e
run 26512080867 on fleet-e2e-win where doer/reviewer settings.json had
compose_permissions output but no `model` key.

Thread `model` through ProviderAdapter.wrapWindowsPrompt signature
(all 5 provider implementations updated; only agy uses it) and invoke
agy-settings-merge.js after Set-Location and before the agy launch.
@kumaakh kumaakh merged commit ce8ee62 into main May 28, 2026
13 checks passed
@kumaakh kumaakh deleted the feat/agy-support branch May 28, 2026 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant