Skip to content

feat: per-account User-Agent for Antigravity to reduce ban risk - #15

Merged
mzrodyu merged 1 commit into
mainfrom
feat/antigravity-ua-rotation
Sep 23, 2026
Merged

mzrodyu merged 1 commit into
mainfrom
feat/antigravity-ua-rotation

Conversation

@mzrodyu

@mzrodyu mzrodyu commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • 原来所有 Antigravity 请求都用同一个写死的 UA(antigravity/hub/2.9.1 darwin/arm64),整个账号池共用一个服务器 IP + 同一 UA,容易被判定为异常客户端
  • 改为按账号派发稳定 UA:从一小组真实客户端 UA(只变 os/arch,不臆造版本号)里按账号 ID 哈希取一个 —— 同一账号每次都报同一客户端(像真实单机用户),不同账号分散到不同平台
  • 说明:故意用「每账号稳定」而非「每请求随机」—— 单账号频繁切平台反而更像机器人
  • 顺带给 Google token 刷新/换取请求也补上 UA,不再泄露默认的 Go-http-client

Testing

  • go vet ./cmd/capi 通过
  • go test ./cmd/capi 全部通过(含新增 TestAntigravityUserAgentForIsStableAndSpread)

后端改动,无前端/dist 变化。

🤖 Generated with Claude Code

Every Antigravity request previously sent one hardcoded client UA
(antigravity/hub/2.9.1 darwin/arm64), so a whole pool of accounts sharing a
server IP fingerprinted as a single identical client. Derive a stable UA per
account from a small pool of realistic client strings (varying only os/arch,
never inventing versions): the same account always reports the same client
like a real single-device user, while different accounts spread across the
pool. Also stamp the UA on the Google token refresh/exchange calls so they no
longer leak the default Go-http-client agent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mzrodyu
mzrodyu merged commit e987eca into main Sep 23, 2026
1 check passed
@mzrodyu
mzrodyu deleted the feat/antigravity-ua-rotation branch September 23, 2026 06:25
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