Documentation
¶
Overview ¶
Package antigravitycli implements the Antigravity model adapter. The CLI binary is `agy`. It is a full peer of the codex/claude adapters — reviewer, synthesizer, and input-budget setter.
Invocation ¶
agy is driven non-interactively via:
agy --print=- --print-timeout <dur> --model <name> (prompt via stdin)
agy's `--print` is a string flag that REQUIRES a value (it is not a boolean toggle); `-` is the conventional stdin marker. agy is multi-model (Gemini, Claude, GPT-OSS variants — see `agy models`); the adapter pins `--model` to DefaultModel so reviews are reproducible rather than depending on agy's user/config session default. Override via SetModel (wired to --antigravity-model / $DIFFSMITH_ANTIGRAVITY_MODEL). When stdin is a pipe, agy reads the prompt from it, so prompts up to the 1 MiB input budget travel via stdin per ADR 0007 rather than argv (past ARG_MAX). Output is raw model text with no envelope, so stdout pipes directly into model.ParseFindings — unlike Gemini's `-o json`, which wrapped output in {"response": …}. There is no --output-schema flag, so JSON reliability is prompt-engineered (the same risk profile as codex without a schema), handled by the defensive parser.
Auth (S8b resolved) ¶
Spike S8b (2026-05-22) stubbed this adapter because agy v1.0.0 required interactive browser OAuth on every invocation. agy 1.0.9 fixed that ("Fixed OAuth token persistence and authentication hangs"), so tokens persist across calls and `agy --print` runs non-interactively once the user has logged in. Preflight only checks that `agy` is on PATH; a user who has never authenticated sees agy's own login prompt surfaced at Review time (the runner propagates stderr), matching codex/claude.
Index ¶
- Constants
- type Adapter
- func (a *Adapter) Name() string
- func (a *Adapter) Preflight(_ context.Context) error
- func (a *Adapter) Review(ctx context.Context, input *review.ReviewInput) (*review.ModelReviewResult, error)
- func (a *Adapter) SetInputBudget(bytes int)
- func (a *Adapter) SetModel(name string)
- func (a *Adapter) Synthesize(ctx context.Context, input *review.ReviewInput, ...) (*review.ModelReviewResult, error)
Constants ¶
const DefaultInputBudgetBytes = 1024 * 1024
DefaultInputBudgetBytes caps the prompt size sent to agy. Matches the codex/claude budget (1 MiB) so users get consistent behavior regardless of model choice. See codexcli for the underlying rationale.
const DefaultModel = "Gemini 3.1 Pro (High)"
DefaultModel is the agy model diffsmith pins by default. agy's own session default is user/config-dependent (often Gemini 3.5 Flash), which would make reviews non-deterministic across machines; pinning a model keeps them reproducible. Gemini 3.1 Pro (High) is a distinct family from codex (GPT) and claude (Claude) for cross-model diversity, with Pro-tier reasoning suited to correctness review. Override via --antigravity-model / $DIFFSMITH_ANTIGRAVITY_MODEL; see `agy models`.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter implements the model.Model interface against the Antigravity CLI (`agy`). agy 1.0.9 resolved the S8b auth blocker (persistent OAuth tokens), so this is a full peer: it reviews, synthesizes, and honors an input budget, matching the codex/claude adapters.
func New ¶
New constructs an Adapter. Passing nil uses provider.IsolatedRunner so agy can't onboard from the caller's cwd; lookPath defaults to exec.LookPath. Tests override fields directly (the package is internal-only).
func (*Adapter) Name ¶
Name returns the model identifier surfaced to users via the picker and attached to validated findings. This is diffsmith's adapter name ("antigravity"), not the underlying agy model (see SetModel/DefaultModel).
func (*Adapter) Preflight ¶
Preflight verifies the agy binary is on PATH. Auth failures (a user who has never run an interactive `agy` login) surface at Review time via agy's own stderr, which the runner propagates — matching codex/claude.
func (*Adapter) Review ¶
func (a *Adapter) Review(ctx context.Context, input *review.ReviewInput) (*review.ModelReviewResult, error)
Review invokes agy against the standard review prompt.
func (*Adapter) SetInputBudget ¶ added in v0.3.0
SetInputBudget overrides the default prompt-size cap. Values <= 0 are ignored so an unset --input-budget flag can't silently disable enforcement and let an arbitrarily large prompt slip through.
func (*Adapter) SetModel ¶ added in v0.3.1
SetModel overrides the agy model passed via --model. An empty name is ignored so an unset --antigravity-model flag can't blank out the pinned default and make agy reject the invocation (mirrors SetInputBudget).
func (*Adapter) Synthesize ¶
func (a *Adapter) Synthesize(ctx context.Context, input *review.ReviewInput, results []*review.ModelReviewResult) (*review.ModelReviewResult, error)
Synthesize runs agy against the synthesis prompt that combines the diff with N other reviewers' findings. Output is parsed identically to Review.