fix(antigravity): 修复个人账号配额查询对齐官方IDE并剥离残留GCP标记 / align quota queries with official IDE for personal accounts and strip orphaned GCP tags - #2326
Merged
jlcodes99 merged 2 commits intoSep 19, 2026
Conversation
…d build guide Ensure scripts/tauri.cjs injects cargoBinPath into PATH and detects vcvars64.bat across Professional/Enterprise/Community/BuildTools editions, preventing raw cargo builds that omit embedded frontend assets.
…tier accounts and strip orphaned GCP tags
|
🤔其实我好奇这个GCP TOS标记是什么意思,搜了一圈也找不到解释。 |
Contributor
Author
|
GCP 似乎是 google 云服务的独立配额系统,但是 实际上 一开始是那个账户的区域是中国大陆,不被 Antigravity IDE 认可登录,所以静默登录失败,账户没有切换,后来 硬是修复了这个大陆区域的账户登录状态,可以登陆,拉取到的API 竟然是企业级的端点路由,后来修复了这个账户区域问题,这个账户的判断代码也需要修改正确。 |
|
实测当前最新版本(v1.3.57)中,个人 Pro 账号确实依然深受该问题困扰(被误识别为 GCP ToS 账号,且 Gemini 5h 配额常驻 100% 无法真实刷新,导致依赖阈值的自动切号功能完全无法生效)。 相关实测数据与现象已在 Issue #2500 中补充记录。此 PR 的根因定位非常精准,恳请作者 @jlcodes99 抽空审阅并尽快合并,感谢!🙏 |
|
今天也遇到了这个情况,希望尽快合并🙏 |
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.
PR 标题 (Title)
fix(antigravity): align quota queries with official IDE for personal accounts and strip orphaned GCP tags / 修复个人账号配额查询对齐官方IDE并剥离残留GCP标记PR 正文 (Description)
🇨🇳 中文说明
背景与问题定位
在主线合入
#2286解决 Antigravity 切换账号及多数据目录注入后,经过实际多账号场景复核,发现了两个影响个人付费订阅账号(standard-tier/ Google One AI Premium)的配额与元数据缺陷:retrieveUserQuotaSummary时,请求 body 为{}(空 Payload,不带任何 project 参数)。Google 服务端收到后会自动绑定该 OAuth 用户的个人订阅真实配额。standard-tier)就属于 GCP ToS 体系,并给没有绑定真实项目的账号自动塞入了一个虚拟占位项目"aicode-consumers"。{ "project": "aicode-consumers" }时,Google 服务端会去查询该空项目的企业配额池,导致即使用户在 IDE 中已消耗了额度,Cockpit Tools 却始终显示为 100%(remainingFraction: 1)。fetch_project_metadata_with_context拿传入的上下文ctx.is_gcp_tos作为初始默认值。由于 Google 原生个人订阅响应中并不返回企业级usesGcpTos字段,导致账号一旦曾被标记过is_gcp_tos=true,代码就永远无法覆盖重置它。resolve_cloud_code_base_url将请求错误路由到了企业生产端点(cloudcode-pa.googleapis.com)而非官方个人结算端点(daily-cloudcode-pa.googleapis.com),进一步加剧了配额失真,且卡片持续误显示【GCP ToS 账号】徽标。本次修复内容
standard-tier与 GCP 判定:usesGcpTos字段,绝不把个人 Pro 订阅(standard-tier)强行判定为 GCP 体系。"aicode-consumers"虚拟项目占位符;无真实 GCP 项目的账号统一发送{},与官方 IDE 行为完全同源。resolve_cloud_code_base_url,只有在账号既标记为 GCP ToS 又拥有真实 GCP Project ID 时才发往生产端点;普通个人账号一律走默认的daily-cloudcode-pa。load_account与配额刷新流程中,若账号无真实 Project ID,自动清洗剥离历史上误存的is_gcp_tos标记,实现平滑自愈。🇬🇧 English Description
Problem & Root Cause
Following the merge of PR
#2286(which resolved account switching and multi-user-data injection for Antigravity), extensive real-world testing across multiple personal paid accounts (standard-tier/ Google One AI Premium) revealed two key regressions:retrieveUserQuotaSummary) are queried with an empty payload{}without specifying aprojectattribute. Google's backend automatically maps this to the user's personal subscription usage.standard-tieraccounts belonged to the GCP ToS system, injecting a placeholder project"aicode-consumers"when no GCP project was bound.{ "project": "aicode-consumers" }causes Google to query an unconsumed enterprise project pool, persistently reporting 100% remaining quota even when substantial quota has been used in the IDE.fetch_project_metadata_with_contextinitializedresolved_is_gcp_toswithctx.is_gcp_tos. Because Google does not include the enterprise-onlyusesGcpTosfield in personal account responses, an account once flagged asis_gcp_tos=truewould permanently inherit the tag in a feedback loop.resolve_cloud_code_base_urlto direct traffic to the enterprise production endpoint (cloudcode-pa.googleapis.com) instead of the official personal settlement endpoint (daily-cloudcode-pa.googleapis.com), causing the card to show a falseGCP ToS Accountbadge and inaccurate quotas.Key Changes in This PR
standard-tierfrom GCP ToS:usesGcpTosreturned by Google API; never infer GCP ToS solely from personal paid tiers."aicode-consumers"placeholder. Query personal accounts with empty payload{}so Google accurately returns individual consumption.resolve_cloud_code_base_urlto only route tocloudcode-pa.googleapis.comif an account is both marked as GCP ToS and possesses a validproject_id. All other personal accounts usedaily-cloudcode-pa.googleapis.com.load_accountand cache validation, automatically sanitize and reset staleis_gcp_tostags when no validproject_idexists, ensuring seamless self-healing for existing installations.