Skip to content

fix(cloud-account): fetch the Gemini 4 Argon quota group - #369

Merged
Draculabo merged 2 commits into
Draculabo:mainfrom
aglinxinyuan:fix/argon-quota-summary
Oct 24, 2026
Merged

Draculabo merged 2 commits into
Draculabo:mainfrom
aglinxinyuan:fix/argon-quota-summary

Conversation

@aglinxinyuan

@aglinxinyuan aglinxinyuan commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • send the Antigravity app's hub client identity on the quota-summary request so AI Pro accounts receive the separate Gemini 4 Argon weekly group
  • query the Daily summary host first and move to the next host on any rejection except 401
  • limit groups named after one model family (Gemini 4 Argon) to that family in auto-switch, recommendations and weekly warmup

Validation

  • 6 focused unit test files (81 tests) and the full unit suite (3354 passed), run locally with vite 7 because tests-unit fails on main (vitest/vite mismatch)
  • live AI Pro account on Windows: the weekly section shows Gemini 4 Argon
  • TypeScript type-check
  • targeted ESLint
Before After

Copilot AI balanced review requested due to automatic review settings October 24, 2026 09:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@codereviewbot-ai

codereviewbot-ai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Summary & Review Outcome: LGTM

The changes address the missing "Gemini 4 Argon" weekly quota group in Google AI Pro accounts cleanly and safely.

Key Highlights Verified:

  1. Hub Client Identity & Version Resolution (request-user-agent.ts, GoogleAPIService.ts):
    • buildHubUserAgent and resolveHubClientVersion correctly implement the required hub identity format (antigravity/hub/<version> (aidev_client; os_type=<os>; arch=<arch>)) with a version floor of 2.26.0.
    • The hub identity is isolated exclusively to GoogleAPIService.fetchQuotaSummary; other Cloud Code calls retain the standard client user-agent.
  2. Quota Summary Host Fallback & Retry Logic:
    • QUOTA_SUMMARY_ENDPOINTS prioritize daily-cloudcode-pa.googleapis.com ahead of production and sandbox.
    • HTTP 403 with project retries once without project on the same host before moving on.
    • HTTP 401 terminates immediately (rejected credential), whereas other host-specific non-2xx errors gracefully advance to the next endpoint without dropping model quota.
  3. Dedicated Quota Group Scoping (quota-groups.ts, quota-model-families.ts):
    • getDedicatedQuotaGroupFamilyId matches registered product families by exact normalized display name.
    • Dedicated groups (such as Gemini 4 Argon) match only tokens of that specific model family, preventing general gemini match tokens from inappropriately bounding other Gemini models (Flash/Pro) by the Argon limit.
  4. Impact on Auto-Switch & Weekly Warmup (AutoSwitchService.ts, WeeklyWarmupService.ts):
    • AutoSwitchService.isAccountDepleted verifies whether any enabled model matches a depleted dedicated quota group family. Because gemini-4-argon-* is not an active proxy model, an exhausted Argon weekly bucket does not trigger account depletion switches for other Gemini models.
    • WeeklyWarmupService.selectWeeklyWarmupCandidates restricts warmup candidates to groups whose dedicated family matches the representative model, preventing warmup requests from being wasted on Argon buckets.
  5. Quality & Documentation:
    • Agent note and module documentation reflect current architecture, decisions, and failure behavior.
    • Comprehensive unit tests cover all new behaviors and edge cases.

🤖 Reviewed by codereviewbot.ai - Catch bugs before your team does.

Google returns model-specific quota-summary groups such as Gemini 4 Argon
only to the Antigravity app's hub client identity on the Daily host. The
quota summary request sent the bare antigravity/<version> identity and
queried the sandbox host first, stopping at its 403, so Google AI Pro
accounts never received the separate Argon weekly limit and some lost
every quota group.

Send the hub identity on the summary request, query Daily, production,
then sandbox, and keep trying after any rejection except HTTP 401. Treat
a group named after one registered model family as limiting only that
family, so an exhausted Argon week no longer lowers Gemini Flash or Pro
scores, recommendations, automatic-switch depletion or weekly warmup.
Describe what the public comparisons actually tested instead of claiming
the bare identity never receives model-specific groups, drop the claim
that Manager usually sent the 2.0.3 fallback version (listing accounts
fills the version cache), and note that the live check changed host
order and identity together.
@aglinxinyuan
aglinxinyuan force-pushed the fix/argon-quota-summary branch from 145d7e3 to d47d5c1 Compare October 24, 2026 09:30
@codereviewbot-ai

codereviewbot-ai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review Summary (LGTM)

The pull request cleanly addresses fetching and handling of the Gemini 4 Argon quota group:

  1. Client Identity & Endpoint Order:

    • request-user-agent.ts introduces buildHubUserAgent and resolveHubClientVersion, correctly maintaining the minimum hub version floor (2.26.0) with semver comparison.
    • GoogleAPIService.fetchQuotaSummary sends the required hub client identity header and prioritizes the Daily host endpoint while gracefully falling back across endpoints for all non-401 responses (preserving 403 project-stripping retries).
  2. Dedicated Quota Group Scoping:

    • quota-model-families.ts and quota-groups.ts correctly register and isolate gemini-4-argon via getDedicatedQuotaGroupFamilyId. Generic provider tokens ('gemini') no longer inadvertently match dedicated family quota groups.
    • AutoSwitchService only flags accounts as depleted for dedicated groups if matching models are enabled.
    • WeeklyWarmupService ensures warmup requests (e.g., using gemini-flash) do not attempt to claim consumption of dedicated quota groups like Gemini 4 Argon.
    • manual-account-recommendation correctly ignores Argon limits when evaluating accounts for Flash/Pro recommendations.
  3. Documentation & Tests:

    • Agent note and module documentation are updated in alignment with repository guidelines.
    • High test coverage provided with targeted unit tests across all updated services.

🤖 Reviewed by codereviewbot.ai - Catch bugs before your team does.

@Draculabo
Draculabo merged commit 2936e4d into Draculabo:main Oct 24, 2026
3 of 5 checks passed
Draculabo pushed a commit that referenced this pull request Oct 26, 2026
# 🚀 Antigravity Manager Release v0.27.0

**Release Date:** 2026-10-26
**Since v0.26.0:** 7 commits · 4 merged PRs · 3 verified contributors

> This release includes updates in Desktop & User Experience, Accounts & Core, Tooling & Maintenance.

---

## ✨ Highlights

- **Feature** — add support for unified state sync account info and active acco… ([#372](#372))
- **Fix** — fetch the Gemini 4 Argon quota group ([#369](#369))
- **Fix** — upgrade vite to 7 so vitest starts ([#370](#370))
- **Fix** — repair AGY eligibility patch targeting ([79f6214](79f6214))
- **Fix** — separate client usage from account actions ([6317b78](6317b78))

---

## 🖥️ Desktop & User Experience

- **Maintenance** — update package metadata to v0.26.0 ([#368](#368))
- **Fix** — repair AGY eligibility patch targeting ([79f6214](79f6214))

---

## 🏗️ Accounts & Core

- **Fix** — fetch the Gemini 4 Argon quota group ([#369](#369))
- **Feature** — add support for unified state sync account info and active acco… ([#372](#372))
- **Fix** — separate client usage from account actions ([6317b78](6317b78))

---

## 🔧 Tooling & Maintenance

- **Fix** — upgrade vite to 7 so vitest starts ([#370](#370))
- **Maintenance** — add risk-aware review workflow ([7ef7706](7ef7706))

---

## 👥 Contributors

Thanks to everyone who contributed to this release.

@aglinxinyuan · @Draculabo · @FisherMS

<details>
<summary>Merged pull requests and authors</summary>

- chore(linux): update package metadata to v0.26.0 by @Draculabo ([#368](#368))
- fix(cloud-account): fetch the Gemini 4 Argon quota group by @aglinxinyuan ([#369](#369))
- fix(build): upgrade vite to 7 so vitest starts by @aglinxinyuan ([#370](#370))
- feat: add support for unified state sync account info and active acco… by @FisherMS ([#372](#372))

</details>

---

**Full Changelog:** v0.26.0...v0.27.0
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.

3 participants