feat: support Antigravity (agy) as local subagent provider - #202
feat: support Antigravity (agy) as local subagent provider#202Waishnav wants to merge 3 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Greptile SummaryAdds Antigravity as a built-in local-agent provider, including CLI invocation, session/model/effort options, availability detection, profile targeting, response extraction, and tests.
Confidence Score: 3/5The 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
|
| 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
Reviews (1): Last reviewed commit: "docs: update subagent delegation skill f..." | Re-trigger Greptile
| 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) { |
There was a problem hiding this comment.
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.
| 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; |
There was a problem hiding this comment.
Add native support for Antigravity's CLI (
agy) as a built-in subagent provider and profile target in DevSpace.When orchestrating subagents, DevSpace runs
agyin 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.