Skip to content

feat: Antigravity reverse-proxy provider with frontend account import - #11

Merged
mzrodyu merged 1 commit into
mainfrom
feat/model-pull-button
Sep 22, 2026
Merged

mzrodyu merged 1 commit into
mainfrom
feat/model-pull-button

Conversation

@mzrodyu

@mzrodyu mzrodyu commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Adds a Google Antigravity provider that reuses the OpenAI account pool (Source == "antigravity"). Accounts authenticate with Google OAuth and forward to Cloud Code v1internal generateContent/streamGenerateContent, translating OpenAI chat requests to the Gemini-style envelope and the SSE response back to OpenAI chunks.

What's included

  • antigravity.go: Google OAuth refresh, GCP project discovery (loadCodeAssist), OpenAI↔Gemini request/SSE translation, non-stream + stream forwarding, and an antigravity-aware account health check.
  • main.go / conversation.go: source-based dispatch in the codex account path, Google refresh in resolveOpenAIAccountAccessToken, refresh-on-import, and the health-check branch.
  • App.tsx: "导入 Antigravity" entry in the add-account modal — paste Google OAuth JSON or a refresh token, tagged source=antigravity. Rebuilt dist bundle included.

Notes

  • Configuration is entirely through the admin UI; no env vars required.
  • The embedded Google OAuth client secret is a public desktop-app secret, XOR-obfuscated in source so GitHub secret scanning does not block the push.

Testing

  • go build ./cmd/capi/ + go test ./cmd/capi/ pass.
  • tsc typecheck clean; production bundle rebuilt.

🤖 Generated with Claude Code

Add a Google Antigravity provider that reuses the OpenAI account pool
(Source == "antigravity"). Accounts authenticate with Google OAuth and
forward to Cloud Code v1internal generateContent/streamGenerateContent,
translating OpenAI chat requests to the Gemini-style envelope and the
SSE response back to OpenAI chunks.

- antigravity.go: OAuth refresh, GCP project discovery (loadCodeAssist),
  request/SSE translation, non-stream + stream forwarding, health check
- main.go/conversation.go: source-based dispatch in the codex account
  path, Google refresh in resolveOpenAIAccountAccessToken, refresh-on-
  import, antigravity-aware account health check
- App.tsx: "导入 Antigravity" entry in the add-account modal; paste
  Google OAuth JSON or a refresh token, tagged source=antigravity
- rebuild dist bundle

Configuration is entirely through the admin UI; no env vars required.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mzrodyu
mzrodyu merged commit 3a4a316 into main Sep 22, 2026
1 check passed
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