Skip to content

feat(core): add the Google Antigravity provider - #65430

Closed
AKOrojo wants to merge 2 commits into
anomalyco:devfrom
AKOrojo:feat/antigravity-provider
Closed

AKOrojo wants to merge 2 commits into
anomalyco:devfrom
AKOrojo:feat/antigravity-provider

Conversation

@AKOrojo

@AKOrojo AKOrojo commented Nov 21, 2026

Copy link
Copy Markdown

Issue for this PR

Refs #28889 — the design question is asked there, and this is the implementation of the ACP route that question is about.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds a built-in antigravity provider: OpenCode runs the Antigravity CLI on the user's machine and talks to it over the Agent Client Protocol, the way the Claude Agent provider runs Claude Code and talks to it through Anthropic's Agent SDK.

Why the ACP runtime and not the print mode. The Antigravity CLI has two headless surfaces, and only one of them may be driven by another program. agy -p is print mode, and Google's own FAQ says wrapping it inside a third-party coding agent "is not supported under consumer plans" — the Antigravity team has said it "violates Section 6 … and can trigger automated account suspension" of the Antigravity Additional Terms. agy acp is the unmodified antigravity-acp runtime, which Google names as usable for single-user interactive development with native oauth-personal sign-in. This provider drives agy acp and never agy -p. That is the difference between this and the requests that were closed as not planned.

The model list is discovered, not pinned. The CLI reports the models the signed-in account may use when it opens a session, and OpenCode registers exactly those, so a model Google adds shows up without a change here. The CLI names the reasoning effort as part of the model — gemini-3.8-flash-high, -medium and -low are one model at three effort levels — so one model is registered per model, with the effort levels as variants, the same shape the Claude Agent provider uses.

Tools. The agent runs its own tools and reports them as tool calls. OpenCode surfaces them as provider-executed calls, so the run shows what the agent did, but OpenCode does not run them: it has no tools with those names. A session/request_permission request is refused unless the host answers it, so the agent never acts on the machine on its own.

Startup. The CLI is started on first use, not when opencode starts, and the model list is kept between starts, so the picker has the models before the CLI answers.

How did you verify your code works?

bun typecheck in packages/core passes. bun test test/plugin/provider-antigravity.test.ts passes (8 tests): the grouping rules (three effort levels become one model with three variants; a single-level model keeps the CLI's name and has no variants; the suffix rule, so claude-opus-4-6-thinking groups under claude-opus-4-6 while claude-sonnet-4-6 does not), the slug resolution, and the stream parts for a message, a tool call and a failed tool call.

Against the real CLI (Antigravity 1.5.14, a Google AI Pro account) the provider connects, opens a session, reports the account's models, and runs a turn:

agent: Antigravity ACP Server 1.5.14
session: 88896779-2e40-4364-9f9e-553832102b83
models: gemini-3.8-flash[high,medium,low] claude-sonnet-4-6[thinking] claude-opus-4-6[thinking] gpt-oss-120b[medium]
turn: end_turn {"input":12923,"output":79,"thought":76,"cacheRead":0,"cacheWrite":0,"total":13002}

The adapter's own stream, through the same session, produces the text and the finish part with the CLI's stop reason and usage.

Not tested: a full opencode run against a ChatGPT-signed-in account is not what this is; what is not tested is the provider inside a running opencode server, which needs a build of this branch.

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

The ChatGPT sign-in's model list was filtered through a hand-maintained set of
ids, because the /models sync was switched off in anomalyco#53466: OpenAI's /models
omits models and marks models hidden that the sign-in still serves, and the
sync then hid them.

That made the list a second, stale copy of the catalog. Eleven of its twenty-two
ids are not in models.dev at all, so they can never be served, and forty-two
catalog models are hidden by it, among them gpt-5.5-pro, gpt-5.6 and gpt-5.4.

The sync is back on, and the list it produces is the union of the pinned set and
the account's own list, so a model the account reports appears without a pull
request, and a model the account leaves out is not taken away. A /models that
fails leaves the pinned set in place.

deriveModels no longer drops the catalog models the remote list omits, and the
model pass no longer disables them, which is what hid them in the first place.
OpenCode runs the Antigravity CLI on the user's machine and talks to it over
the Agent Client Protocol, the way the Claude Agent provider runs Claude Code
and talks to it through Anthropic's Agent SDK.

The CLI's `agy acp` runtime is used, not its print mode: Google's Antigravity
FAQ says wrapping `agy -p` inside a third-party coding agent is not supported
on consumer plans, and section 6 of the Antigravity Additional Terms says using
third-party software to access the Service is a breach. The unmodified
`antigravity-acp` runtime with native `oauth-personal` sign-in is the
integration Google names as usable for single-user interactive development.

- The model list comes from the account, so it is never written down here.
- The CLI names the reasoning effort in the model, so one model is registered
  per model with the effort levels as variants, the same shape the Claude Agent
  provider uses.
- The agent runs its own tools, reported as provider-executed calls; a
  permission request is refused unless the host answers it.
- The CLI is started on first use, and the model list is kept between starts so
  the picker has the models before the CLI answers.

Refs anomalyco#28889
@AKOrojo
AKOrojo marked this pull request as ready for review November 21, 2026 23:04
Copilot AI balanced review requested due to automatic review settings November 21, 2026 23:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@opencodejr opencodejr Bot closed this Nov 21, 2026
@opencodejr

opencodejr Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Thanks for the detailed write-up and the testing against the real CLI, @AKOrojo!

This pull request bundles two unrelated changes, and together they are too large to review as one. Could you split it into smaller, focused pull requests that can each be reviewed on its own? For example:

  • ChatGPT model sync: the fix(core): make the ChatGPT model sync additive instead of subtractive commit (chatgpt.ts and its test). It stands on its own and has nothing to do with Antigravity.
  • Antigravity provider: the antigravity provider with its docs and spec. Since [FEATURE]: Add Antigravity CLI connector & Google OAuth provider #28889 was closed as not planned, it would help to get a maintainer's answer to your question there about the agy acp route before opening this one again.

You're welcome to open those as separate pull requests.

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.

2 participants