Skip to content

fix(antigravity): request quota summary with the CLI fingerprint so Argon usage shows - #7804

Merged
lidge-jun merged 3 commits into
lidge-jun:devfrom
junhoi-pk:fix/antigravity-argon-quota-cli-ua
Oct 27, 2026
Merged

lidge-jun merged 3 commits into
lidge-jun:devfrom
junhoi-pk:fix/antigravity-argon-quota-cli-ua

Conversation

@junhoi-pk

@junhoi-pk junhoi-pk commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The Antigravity quota panel never shows Gemini 4 Argon usage. The summary probe sends the IDE User-Agent, and Cloud Code Assist returns the Argon group from v1internal:retrieveUserQuotaSummary only to the CLI client family, the same CLI-only gate that already applies to Argon inference and model discovery (antigravityUserAgentForWireModel).

Live check on one Pro account where almost all traffic was gemini-4-argon:

Summary request User-Agent Groups returned
antigravity/ide/... (current) Gemini Models 0% used, Claude and GPT models 0% used
antigravity/cli/1.3.4 ... (this PR) the same two groups, plus Gemini 4 Argon weekly bucket at 34% used

So the dashboard showed four bars at 0% while the Argon weekly limit was a third gone. The CLI response is a superset of the IDE response, so the Gem/Cla bars are unchanged.

The parser already handles the Argon group (#7283, structure/providers-and-adapters.md); this PR only changes which fingerprint asks for it:

  • src/providers/quota/antigravity.ts: the summary request uses antigravityCliUserAgent(). The 403 retry still uses antigravity/1.0, and the fetchAvailableModels fallback keeps the IDE UA (under the CLI UA that list drops the Claude rows). Argon windows stay display-only, as before.
  • structure/transports/inventory.md, docs-site provider reference, and the antigravityCliUserAgent doc comment now say the CLI fingerprint is used for the quota summary too.

#7668 includes this same User-Agent change together with label, auth-surface, and failover changes and is currently blocked on review. This PR takes only the quota fingerprint fix so it can land on its own; the maintainer's round-2 review there named the CLI fingerprint as one of the parts not yet covered. Refs #7500.

Verification

  • bun test tests/providers/provider-antigravity-quota-retry.test.ts tests/providers/provider-quota.test.ts tests/providers/provider-account-quota.test.ts tests/providers/provider-antigravity-model-quota.test.ts tests/routing/jev-quota-antigravity.test.ts tests/server/provider-account-quota-routes.test.ts: 311 pass, 0 fail.
  • New regression test summary is requested with the CLI fingerprint so the Argon group is reported replays the live response shape and expects an Argon (Weekly) window tagged gemini-4-argon. With the source change reverted, the retry test file fails (16/16) because the summary call goes out with the IDE UA.
  • bun x tsc --noEmit, bun scripts/structure-ssot.ts, bun scripts/privacy-scan.ts: pass.
  • bun run test (Bun 1.4.4, macOS arm64): every file passes except tests/ci-workflows/release-helper.test.ts (28 failures, all posix_spawn 'git' ENOENT from the runner's PATH on this machine). That file passes 40/40 when run alone, both with and without this change; it does not touch this diff.
  • Manual: probed the live endpoint with the stored OAuth credential under both User-Agents (table above).

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. (Same bearer, project and pinned accounting host; only the User-Agent header changes.)

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • Required local validation passed; commands, results, and any full-suite exception are documented.

  • I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

Summary by CodeRabbit

  • Bug Fixes
    • Antigravity quota summaries now use the appropriate CLI identity, helping report the Gemini 4 Argon weekly quota window when available.
    • If a quota-summary request receives a 403, it retries once with a legacy identity. Authentication failures (401) are not retried.
    • Other quota lookups continue using the IDE identity.
  • Documentation
    • Updated Antigravity quota guidance to reflect the request and fallback behavior.

…rgon usage shows

Cloud Code Assist includes the Gemini 4 Argon group in
retrieveUserQuotaSummary only for the CLI client family. Under the IDE
User-Agent the same account reports just the Gemini and Claude groups, so
the dashboard never showed Argon usage even when Argon was the only model
consuming quota. The models fallback keeps the IDE fingerprint and the 403
retry keeps antigravity/1.0.
@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Oct 27, 2026
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • review readiness checklist open (0/4 boxes ticked).

What to do

  • Tick all four boxes in the PR description once you're done (currently 0/4).

Review readiness checklist

  • ⬜ Required local validation passed; commands, results, and any full-suite exception are documented.
  • ⬜ I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
  • ⬜ I resolved all correct Codex and CodeRabbit findings.
  • ⬜ My PR is ready for review.

0/4 boxes ticked.

This PR stays in draft until every box above is ticked.

Hygiene

✅ Deterministic PR hygiene checks passed.

@github-actions
github-actions Bot marked this pull request as draft October 27, 2026 05:22
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 736fa50 and 38994c5.

Files selected for processing: 5
  • docs-site/src/content/docs/reference/configuration/providers.md
  • src/adapters/client-fingerprint.ts
  • src/providers/quota/antigravity.ts
  • structure/transports/inventory.md
  • tests/providers/provider-antigravity-quota-retry.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The Antigravity quota-summary request now uses the CLI User-Agent. The existing 403 retry remains, and the models fallback and non-Argon inference retain the IDE User-Agent. Tests and documentation reflect the User-Agent selection and Argon quota window.

Changes: Antigravity quota request

Layer / File(s) Summary
Quota request User-Agent selection
src/providers/quota/antigravity.ts, src/adapters/client-fingerprint.ts, tests/providers/provider-antigravity-quota-retry.test.ts, docs-site/src/content/docs/reference/configuration/providers.md, structure/transports/inventory.md
The quota-summary request uses the CLI User-Agent, while the models fallback explicitly uses the IDE User-Agent. Tests check the summary fingerprint and the parsed Argon weekly window. Documentation describes the request behavior and the retained 403 retry.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Suggested labels: bug

Merge Risk: Minimal · previous review 38994

No actionable merge-blocking risk remains from the reviewed change.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surv… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and specifically describes the main change: using the Antigravity CLI fingerprint for quota-summary requests so Argon usage appears.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 3 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lidge-jun

Copy link
Copy Markdown
Owner

Maintainer dev integration decision (lane L7, under MAINTAINERS.md maintainer dev integration).

  • Exact head: 296c98a8a2b94922e70dd76c4a80319be3e71e57 (author's 38994c505 plus two maintainer dev merges via update-branch; remerge diffs empty; stable patch id unchanged).
  • Exact-head CI: Cross-platform CI run 40544623784 success on attempt 3 (gates, test changed, structure, docs build, docker, npm-global, storage, api usage). Attempt 1 failed only test changed on tests/responses/ws-native-steering.test.ts "large output arrays stay ordered below the replay byte limit" (5 s timeout under runner load; the same case timed out on fix(codex): keep native main available after keyring migration #7774's head, passes locally in about 1.7 s, and this PR does not reach that code). The failed job was rerun once with that evidence recorded; nothing else changed. Catalog async contracts, PR hygiene and Enforce PR target branch succeeded.
  • Independent review (gpt-6.1-sol, Antigravity quota request with an OAuth bearer): PASS, 0 blocking, at this exact head. Same bearer, project and pinned accounting host; only the User-Agent changes; 403 fallback order preserved.
  • Current dev 3481acea5 merges cleanly; merged-tree typecheck passes and the quota test files pass (184).

Marking ready and squash-merging. Refs #7500 (the paid/trial part stays open).

@lidge-jun
lidge-jun marked this pull request as ready for review October 27, 2026 22:14
@lidge-jun
lidge-jun merged commit c5c2196 into lidge-jun:dev Oct 27, 2026
46 of 48 checks passed
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-27T22:14:10.764788Z 296c98a Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants