Skip to content

feat: admin-configurable Antigravity client version and model catalog - #16

Merged
mzrodyu merged 1 commit into
mainfrom
feat/antigravity-configurable-version-models
Sep 23, 2026
Merged

mzrodyu merged 1 commit into
mainfrom
feat/antigravity-configurable-version-models

Conversation

@mzrodyu

@mzrodyu mzrodyu commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • 新增「设置 → Antigravity」标签页,可后台配置客户端版本号和可选模型清单,改完保存即时生效、免重发版;留空回退内置默认
  • User-Agent 现在用配置的版本号 + 每账号稳定平台拼装(防封的 UA 伪装 + 可调版本)
  • 新增「从上游拉取模型」:用账号池里一个账号调真实上游 POST /v1internal:fetchAvailableModels(body {project},模型 ID 是响应 models 对象的键),管理员用自己的凭证拉真实可用模型,合并进可编辑清单后保存
  • 后端:AntigravitySettings{clientVersion, models} 持久化;GET/PATCH /api/settings/antigravity;POST /api/channels/:id/antigravity/available-models 探测端点;模型默认清单降级为 fallback

Testing

  • 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

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>
@mzrodyu
mzrodyu merged commit dd69bbf into main Sep 23, 2026
1 check passed
@mzrodyu
mzrodyu deleted the feat/antigravity-configurable-version-models branch September 23, 2026 07:12
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