Skip to content

feat: support Antigravity (agy) as local subagent provider - #202

Closed
Waishnav wants to merge 3 commits into
mainfrom
feat/antigravity-subagent-support
Closed

feat: support Antigravity (agy) as local subagent provider#202
Waishnav wants to merge 3 commits into
mainfrom
feat/antigravity-subagent-support

Conversation

@Waishnav

Copy link
Copy Markdown
Owner

Add native support for Antigravity's CLI (agy) as a built-in subagent provider and profile target in DevSpace.

When orchestrating subagents, DevSpace runs agy in headless print mode (--dangerously-skip-permissions --output-format json --print "<prompt>"), supporting model selection (--model), reasoning effort (--effort), workspace directory binding (--add-dir), and multi-turn conversation resumption (--conversation). The adapter strictly extracts the final synthesized assistant response (extractAntigravityFinalResponse), ensuring intermediate tool calls, terminal outputs, and raw transcripts remain bounded and isolated from the orchestrator.

@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 36a7373b-faf3-42dc-a31e-6628bdb27821

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Waishnav Waishnav closed this Aug 15, 2026
@greptile-apps

greptile-apps Bot commented Aug 15, 2026

Copy link
Copy Markdown

Greptile Summary

Adds Antigravity as a built-in local-agent provider, including CLI invocation, session/model/effort options, availability detection, profile targeting, response extraction, and tests.

  • Registers antigravity across provider profiles, targets, and availability reporting.
  • Adds an agy process adapter with JSON parsing and conversation resumption.
  • Extends delegation guidance and adapter coverage for the new provider.

Confidence Score: 3/5

The PR should not merge until Antigravity process failures are propagated correctly and warning-prefixed valid JSON responses are parsed without corrupting brace-containing payloads.

The adapter can report failed agy invocations as successful delegated responses, while its warning recovery rejects valid responses containing common code or JSON braces.

Files Needing Attention: src/local-agent-adapters.ts, src/local-agent-adapters.test.ts

Important Files Changed

Filename Overview
src/local-agent-adapters.ts Adds the Antigravity CLI adapter and response parser, but failure statuses can be returned as successes and warning-prefix recovery mishandles braces within valid payloads.
src/local-agent-adapters.test.ts Covers argument construction and basic parsing, but omits nonzero/error records and warning-prefixed payloads containing braces.
src/local-agent-profiles.ts Registers Antigravity as a valid provider and updates profile validation messaging.
src/local-agent-availability.ts Adds availability detection using AGY_COMMAND or the default agy executable.
skills/subagent-delegation/SKILL.md Adds agy to the list of provider CLIs that should be invoked through DevSpace.

Sequence Diagram

sequenceDiagram
    participant O as DevSpace orchestrator
    participant A as Antigravity adapter
    participant C as agy CLI
    O->>A: run(prompt, workspace, profile, session)
    A->>C: agy --output-format json --print ...
    C-->>A: exit code, stdout, stderr
    A->>A: Parse trailing JSON and extract response
    alt Valid successful result
        A-->>O: LocalAgentRunResult
    else Process or structured failure
        A--xO: Throw provider error
    end
Loading

Reviews (1): Last reviewed commit: "docs: update subagent delegation skill f..." | Re-trigger Greptile

Comment on lines +412 to +419
if (exitCode !== 0 && !stdout.trim()) {
throw new Error(`Antigravity CLI exited with code ${exitCode ?? "null"}${stderr ? `:\n${stderr.trim()}` : "."}`);
}

const record = parseAntigravityOutput(stdout);
const status = typeof record.status === "string" ? record.status : undefined;
const isError = status === "ERROR" || status === "FAILED" || record.is_error === true;
if (isError && !record.response) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Failed runs reported as successful

When agy exits nonzero with JSON stdout, or returns an ERROR/FAILED record containing a response, the adapter returns that response as a normal result instead of throwing, causing the orchestrator to store diagnostic or partial output and mark the failed run as idle.

Comment on lines +474 to +478
const lastOpenBrace = trimmed.lastIndexOf("{");
const lastCloseBrace = trimmed.lastIndexOf("}");
if (lastOpenBrace !== -1 && lastCloseBrace > lastOpenBrace) {
try {
const parsed = JSON.parse(trimmed.slice(lastOpenBrace, lastCloseBrace + 1)) as unknown;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Brace recovery corrupts valid JSON

When warning-prefixed output contains braces in the response text or a nested object, lastIndexOf("{") starts the recovery slice inside the payload rather than at its root, causing a successful delegated response to be rejected as malformed JSON.

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