feat: admin-configurable Antigravity client version and model catalog - #16
Merged
Merged
Conversation
The Antigravity client version (used in the spoofed User-Agent) and the routable
model catalog were both hardcoded, so updating either needed a redeploy. Add an
AntigravitySettings block (clientVersion + models) persisted in app settings and
edited from a new Settings → Antigravity tab; empty fields fall back to the
baked-in defaults. The per-account User-Agent now interpolates the configured
version over the stable platform pool.
Add a "从上游拉取模型" action that calls the real upstream fetchAvailableModels
(POST /v1internal:fetchAvailableModels with {project}) using one of the pool's
own accounts, so admins discover the live model list with their own credential
and merge it into the editable catalog before saving.
Rebuild the frontend bundle (index-D9XDLNLM.js).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
POST /v1internal:fetchAvailableModels(body{project},模型 ID 是响应models对象的键),管理员用自己的凭证拉真实可用模型,合并进可编辑清单后保存AntigravitySettings{clientVersion, models}持久化;GET/PATCH /api/settings/antigravity;POST /api/channels/:id/antigravity/available-models探测端点;模型默认清单降级为 fallbackTesting
go vet ./cmd/capi通过go test ./cmd/capi全部通过(新增 UA/version/probe-account 测试)tsc -b+vite build通过,新 bundle index-D9XDLNLM.js说明
上游确有该接口(多个开源实现印证:
cloudcode-pa.googleapis.com/v1internal:fetchAvailableModels)。我无真实 Antigravity 账号做端到端验证,上线后请拿真号点一次「从上游拉取」确认返回模型;若 404/403,端点常量集中在 antigravity.go 便于调整。🤖 Generated with Claude Code