These docs track main. Latest release: v2.0.0.

Skip to Content
antigravity-booster
Reference

agy integration

How agb invokes the agy CLI: arguments, --project isolation, output formats, stream limits, timeouts and environment scrubbing.

Every model call agb makes goes through one function, runAgy in lib/agy.mjs: one call, one agy process, one structured result. It never throws on an agent failure; it returns { ok, output, ms, error, kind } and lets the caller decide. agb requires agy 1.5.17 or later (agb doctor checks this) (MIN_AGY_VERSION).

Invocation

agy --print <prompt> --print-timeout <timeout> --model <slug>
    [--output-format json|stream-json] [--json-schema <schema>]
    [--disable-slash-commands] [--effort <low|medium|high|xhigh|max>]
    [--project <name> --add-dir <cwd>] [--conversation <id>] [--sandbox]

The arguments are built as an array and spawned without a shell, so nothing in a prompt is shell-interpreted; --disable-slash-commands is enabled by default in lib/agy.mjs to eliminate slash-command scanning overhead on automated workers. Display names such as Gemini 4 Hydrogen (Low) are mapped to agy model slugs first (and --effort is omitted for Orchestrator models, which use a fixed reasoning budget in the CLI). The agy binary is AGB_AGY_BIN if set, else agy on PATH.

--project isolation

--project <name> scopes agy's conversation and state to a named project, and agb adds --add-dir <cwd> so that project can see the ticket worktree (project args). agb run passes the --project you give on the command line (flag parsing); without one, every builder in the run shares a fresh project named agb- followed by the run id, for example agb-run-lq2x1k, so a run never leaks into your interactive Antigravity conversations (default project). review and preflight pass --project through the same way.

agb sweep --project <name> behaves the same way: the sweep is converted to a plan and run with that project, so every builder and prosecutor session in the sweep runs under it.

Output formats

FormatUsed forWhat agb reads
text (default)short prompts such as agb probestdout; a trailing Error: timed out waiting for response line on short output is treated as an agy timeout (isAgyTimeout)
jsonstructured calls (plan gates, prosecution)the parsed envelope; status: error or failed becomes kind: envelope_error; with --json-schema, structured_output is validated and a mismatch becomes kind: schema_violation
stream-jsonbuilders (scheduler)newline-delimited events: step_update, heartbeat, and a terminal result with status SUCCESS or ERROR and exit_code (event parsing)

Conversation ids

The json and stream-json outputs carry agy's conversation metadata, including the conversation id. runAgy extracts the conversation id into result.conversationId from conversation_id or conversationId on stream-json events and terminalResult (C34) and from envelope.conversation_id or envelope.conversationId for json (C34), and also returns result.envelope and result.terminalResult. Callers can resume an earlier session by passing conversation: <id> to runAgy (which appends --conversation <id>). When agb itself runs inside an Antigravity conversation, ANTIGRAVITY_CONVERSATION_ID is forwarded to child agy processes even when the environment is scrubbed (forwarding).

Stream limits

stream-json output is bounded by three hard-coded caps (C2):

LimitValue
One line1 MB
Whole stream50 MB
Consecutive unparseable output5 MB

Exceeding any of them kills the process tree and fails the call. There are no environment variables for these limits.

Timeouts

A builder call is bounded by up to three independent timers. Whichever fires first kills the agy process tree (SIGTERM, then SIGKILL after 10 s) and the call fails with kind: timeout.

TimerDefaultSet byNotes
Per-call timeout15m for buildersAGB_BUILD_TIMEOUT (C19)Passed to agy as --print-timeout, enforced locally after a grace period (AGB_KILL_GRACE_MS, default 15 s). For stream-json, an empty value or 0 means no per-call limit (C19).
Wall-clock ceiling30mAGB_BUILD_MAX_TIMEOUTAlways on, even when the per-call timeout is unlimited (C19).
No-progress watchdog5mAGB_EVENT_PROGRESS_TIMEOUTReset by each stream event; fires when agy goes silent (C19).

Timeouts accept 90s, 10m or 1h; a bare number means minutes, and an unparseable value falls back to 10 minutes (parseTimeoutMs). Long builds are not capped by agy itself: with stream-json and AGB_BUILD_TIMEOUT=0, a build may run until the 30 minute ceiling as long as it keeps emitting events.

Environment

Builder calls (and any call with sanitizeEnv) get a scrubbed environment (sanitizing spawn env). A variable is passed only if it is on the allowlist (PATH, HOME, USER, LANG, TERM, NODE_ENV, TMPDIR, git config isolation variables) or starts with AGB_ or ADLC_, and is not a known secret, does not match KEY|TOKEN|SECRET|PASSWORD|AUTH|CREDENTIAL|PRIVATE|CERT, and is not a runtime-injection variable such as NODE_OPTIONS or LD_PRELOAD (isAllowedEnvVar). Each builder also gets a ticket-scoped ADLC_TICKET and ADLC_P4_ENFORCEMENT when live enforcement is available, and a worker marker (AGB_WORKER_TICKET or AGB_WORKER_MODE=readonly) the in-session policy guard reads. See Security.

Sandbox

Builders must run sandboxed. On macOS and Linux, agb wraps the agy process in an outer kernel sandbox — sandbox-exec (Seatbelt) on macOS, with writes limited to the worktree and temp directories and reads of credential files such as ~/.ssh, ~/.aws and ~/.npmrc denied (Seatbelt profile), and bubblewrap (bwrap) on Linux, with the worktree writable and the rest of the host read-only. This outer kernel containment replaces agy's nested --sandbox flag to avoid nested sandbox failures on agy 1.5.9 (on platforms without outer kernel containment, agy's --sandbox flag is passed directly). On macOS and Linux an unsandboxed builder is refused outright; on Windows it needs a verified sandboxBypassAttestation (builder sandbox rule). Details are on Gates and sandboxing.

Failure kinds

ALL_AGY_ERROR_KINDS classifies outcomes into 17 canonical error kinds:

kindCause
containment_unavailableThe required kernel sandbox could not be set up, or a Windows bypass attestation was denied.
stream_overflowStreamed line (> 1 MB) or total output (> 50 MB) exceeded hard bounds.
stream_corruptionConsecutive unparseable stream bytes exceeded the 5 MB corruption limit.
timeoutPer-call, wall-clock ceiling, or no-progress watchdog timer fired.
spawnagy binary failed to spawn (ENOENT, EACCES, etc.).
signalChild terminated abnormally due to an OS signal.
interruptedRun was interrupted or cancelled externally.
model_unavailableConfigured model slug was unknown or unavailable on the host account.
envelope_errorJSON envelope reported an explicit error / failed status.
serveragy reported an error or terminal result with status ERROR / non-zero exit_code.
server_shutdown_errorProcess exited non-zero despite reporting an intermediate SUCCESS.
cliagy CLI invocation exited non-zero without a structured envelope error.
missing_terminal_resultstream-json closed without emitting a terminal result event.
missing_structured_outputJSON/schema invocation completed without parseable structured output.
schema_violationStructured output failed validation against --json-schema.
emptyChild produced empty stdout on a mode requiring output.
unclassifiedNon-zero / unexpected failure not matched by the rows above.

On this page