feat(opencode): add Antigravity CLI connector#31066
Open
anisches wants to merge 1 commit into
Open
Conversation
Contributor
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
0793b9b to
a75ba1b
Compare
Reuse an existing Google Antigravity CLI (`agy`) sign-in inside opencode and route inference through Google's Code Assist backend — no new login, no API keys. - Auth: read agy's OAuth session from the OS credential store — macOS Keychain, Linux Secret Service, Windows Credential Manager (CredRead); refresh using agy's own client, whose id/secret are read from the agy binary at runtime rather than shipped in source. - Model discovery: fetchAvailableModels (gated behind the `antigravity` User-Agent) returns the authoritative catalog with real display names and limits — Gemini, Claude Sonnet/Opus 4.6, and GPT-OSS. - Inference: rewrite @ai-sdk/google requests into the Code Assist v1internal envelope and unwrap responses (JSON + SSE). - Tool calls: synthesize and FIFO-pair the tool-call ids @ai-sdk/google drops for regular tools, which the backend needs to build Anthropic tool_use / OpenAI tool_calls — this is what makes Claude/GPT-OSS work. - Core: let a plugin's provider hook self-register a minimal catalog record when models.dev/config doesn't have it (ProviderHook gains an optional name). Verified end-to-end on macOS, Linux, and Windows. Closes anomalyco#28889.
a75ba1b to
d3d29f0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #28889
Type of change
What does this PR do?
Adds a provider that reuses an existing Antigravity CLI (
agy) sign-in — Gemini, Claude, and GPT-OSS with no extra login or API key.fetchAvailableModels(only responds with theantigravityUser-Agent); rewrite@ai-sdk/googlerequests into thev1internalenvelope; unwrap responses (JSON + SSE)@ai-sdk/googleomits for regular tools — Gemini pairs by position, but the backend maps them to Anthropictool_use/ OpenAItool_calls, which need a matching id, so Claude/GPT-OSS otherwise failproviderhook (adds optionalnametoProviderHook), so it needs no config entry and survives catalog refreshessecurity), Linux Secret Service (secret-tool), Windows Credential Manager (CredReadvia PowerShell) — handling go-keyring's base64-on-macOS vs raw-JSON-on-Linux/Windows value formatsHow did you verify your code works?
generateContentwith tool calls, across Gemini, Claude Sonnet/Opus, and GPT-OSSbun test test/plugin/google-antigravity.test.ts(12 pass — envelope translation, SSE unwrap, fallback catalog, auth loader, tool-call id pairing)bunx tsc --noEmit -p tsconfig.jsoninpackages/opencodeScreenshots / recordings
Not a UI change.
Checklist