Skip to content

feat: add the Antigravity agent driver (@agentry/antigravity) - #5

Merged
dortort merged 5 commits into
mainfrom
feat/antigravity-driver
Aug 8, 2026
Merged

feat: add the Antigravity agent driver (@agentry/antigravity)#5
dortort merged 5 commits into
mainfrom
feat/antigravity-driver

Conversation

@dortort

@dortort dortort commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

Adds @agentry/antigravity, a driver that drives Google's Antigravity CLI (agy) headlessly via agy -p --output-format stream-json and normalizes its native stream into the shared Agentry AgentEvent model — the same contract @agentry/claude implements. Wires it into the CLI so agentry test/record can target Antigravity with use: { agent: 'antigravity' }.

Antigravity supersedes the Gemini CLI for personal use; its agy CLI is a genuine headless, structured-output agent runner, so it earns a first-class driver.

How it works

The event schema was captured live from agy 1.1.11 (a fresh feasibility spike). Antigravity's stream is discriminated on event (not type). parseAntigravityEvents is a pure whole-stream mapper:

Native (agy --output-format stream-json) AgentEvent
init{init:{cwd,tools}} run.start
step_update{step_type:'tool', state:'ACTIVE'/'DONE'} tool_use/tool_result
step_update{step_type:'agent_response', text_delta} message (coalesced by step_index)
result{status,usage} usage + run.end

Key details: agent_response text streams as deltas, coalesced per step_index into one message. Usage and run.end come from the authoritative terminal result event (input_tokens/output_tokens/cache_read_tokens). Spawns with stdin ignored.

Capabilities

{ structuredStream: true, llmInterception: 'none',
  mcpTransports: [], toolPermissionControl: true, nativeBudgetControl: false }

Model ids are agy's own pinned names, e.g. claude-sonnet-4-6 or gemini-3.5-flash-medium.

Known limitations (MVP)

  • Sandbox fs-diff is best-effort. agy writes to its own project/scratch dir by default rather than the process cwd; buildArgs passes --add-dir <sandbox>, but the agent may still use its scratch dir, so file side-effect assertions on the sandbox may miss writes. Event-stream normalization (tools, messages, usage) is fully faithful.
  • LLM interception is 'none' (routed through Antigravity's backend; not interceptable via env base-URL). Transcript record/replay works; wire cassettes do not apply.
  • MCP transports unverified, declared [] rather than overclaiming.
  • allowedTools/disallowedTools/mcpConfig/maxBudgetUSD/appendSystemPrompt are ignored in MVP.

Testing

  • pnpm typecheck clean; new-package tests green (parser incl. per-step delta coalescing + buildArgs); full suite 93 tests, 0 failures, no regressions.
  • Parser fixtures are the live-captured agy 1.1.11 stream.
  • agentry doctor probes the agy CLI (found v1.1.11) and prints the driver's capabilities.

Merge notes

  • Branched off main. Additively touches three files the sibling Codex/Gemini PRs also touch — the selectDriver switch in packages/cli/src/commands/run.ts, doctor.ts, and the tsconfig.json/vitest.config.ts aliases. Whichever PR merges later needs a trivial union-merge.
  • No changeset included: the changesets system is being introduced separately on chore/release-workflow. When that lands, add @agentry/antigravity to the fixed-version group and a changeset entry.

🤖 Generated with Claude Code

@dortort dortort self-assigned this Aug 8, 2026
dortort and others added 5 commits August 8, 2026 17:02
…r it in the workspace

New workspace package mirroring @agentry/claude; adds the tsconfig path, vitest alias, and CLI dependency so the driver resolves across typecheck, tests, and the CLI.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…entry event model

parseAntigravityEvents is a pure whole-stream mapper over agy's event-discriminated stream (init, step_update, result). agent_response text streams as deltas and is coalesced per step_index; tool steps map ACTIVE/DONE to tool_use/tool_result; usage and run.end come from the authoritative terminal result event. Schema captured live from agy 1.1.11.

Constraint: agy discriminates on `event` (not `type`) and streams agent_response text as deltas coalesced by step_index
Rejected: Rely on cwd for file side-effects | agy writes to its own project/scratch dir, so sandbox fs-diff is best-effort even with --add-dir
Confidence: high
Scope-risk: narrow
Directive: Event schema captured from agy 1.1.11; re-verify the stream if bumping Antigravity
Not-tested: sandbox fs capture when agy uses its scratch dir; MCP transports unverified (declared [])
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Fixtures are the live-captured agy 1.1.11 stream; asserts delta coalescing by step_index, tool calls, terminal usage, and run.end.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
selectDriver(config.use.agent) routes 'antigravity' to AntigravityDriver and defaults to Claude; doctor probes the agy CLI and prints its capabilities.

Constraint: Parallel driver branches each extend this switch; kept minimal for clean union merges
Confidence: high
Scope-risk: narrow
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dortort
dortort force-pushed the feat/antigravity-driver branch from ddce684 to aef9bcb Compare August 8, 2026 21:05
@dortort
dortort merged commit 6e41c1e into main Aug 8, 2026
1 check passed
@dortort
dortort deleted the feat/antigravity-driver branch August 8, 2026 21:06
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