Skip to content

fix(usage): read Antigravity quota from Agy, not the Gemini mirror - #16710

Open
brennanb2025 wants to merge 10 commits into
mainfrom
brennanb2025/sta-2011-antigravity
Open

brennanb2025 wants to merge 10 commits into
mainfrom
brennanb2025/sta-2011-antigravity

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 19 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1451 $\color{#cf222e}{\Huge{\mathbf{−}}}$​109 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1342
Prod 18 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​973 $\color{#cf222e}{\Huge{\mathbf{−}}}$​115 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​858

ELI5

Orca already treats Gemini and Antigravity as different usage meters, but before this PR it filled both meters from Gemini. Agy is the Antigravity CLI; after this PR, the Antigravity meter asks Agy for Antigravity’s own quota while the Gemini meter keeps asking Gemini for Gemini quota.

This is like fixing which utility meter Orca reads. It is not adding another account form to Settings.

Settings and account ownership

Is Agy now a separate provider account in Settings? No. This PR does not add an Agy or Antigravity entry under Settings → AI Provider Accounts. The Settings account surface is unchanged.

  • Gemini remains the existing Gemini provider account in Settings. Its “Use Gemini CLI credentials” opt-in controls only Gemini quota, read from Google’s Gemini/Code Assist quota endpoint.
  • Antigravity remains a separate usage provider/status-bar item, but not a Settings account entry. Agy is the CLI and quota data source for Antigravity, and Agy owns its own sign-in outside Orca; Orca does not create, store, or switch Agy accounts.
  • The PR removes the old dependency between them: Antigravity quota no longer uses the Gemini snapshot or the Gemini OAuth setting, and Antigravity errors no longer send users to Gemini Settings.

The ~/.gemini/antigravity-cli/log path is Agy’s own language-server log location; that directory name does not mean Orca is using the Gemini provider account.

User-facing before / after

Surface Before this PR After this PR
AI Provider Accounts Gemini is present; there is no Agy/Antigravity account entry. Unchanged: Gemini is present; there is still no Agy/Antigravity account entry.
Gemini usage Reads Gemini quota when the Gemini CLI credential opt-in is enabled. Unchanged: still reads and displays Gemini quota independently.
Antigravity usage Re-labels a successful Gemini quota snapshot as Antigravity, so the displayed number belongs to Gemini rather than Antigravity. Reads Antigravity’s native quota groups from the signed-in Agy language server and displays them only as Antigravity.
Sign-in / troubleshooting A missing Antigravity value could point users at Gemini Settings even though Gemini credentials cannot describe Agy’s account. Sign in through agy; Orca distinguishes “Agy not running,” “Agy signed out,” and “quota unreadable,” without routing to Gemini Settings.

What Changed

  • New fetchAntigravityRateLimits reads quota from the host-local Agy LanguageServer instead of copying the Gemini snapshot.
  • Discovery reads ~/.gemini/antigravity-cli/log/cli-*.log. Every agy run writes its own pid and both loopback ports in the first lines of that log, so no lsof, ps, process table, or command-line inspection is needed on any platform.
  • Newest run first, and the newest run settles it. A long-lived agy keeps the account it started with in memory across a sign-out, so an older process will confidently answer with a stale account's quota. Log names sort chronologically; dead pids are filtered with process.kill(pid, 0). When the newest live server answers at all — with quota or with "signed out" — that is the answer; older servers are consulted only when the newest could not be reached, which teaches nothing about the account.
  • Plaintext port first. agy listens on two adjacent ports — one HTTPS (self-signed), one plain HTTP — and both serve the RPC. Trying HTTP first means the common path needs no TLS exception at all; the self-signed fallback is pinned to 127.0.0.1.
  • All four native buckets are published with their independent reset times; compact views summarise each window with its most constrained pool.
  • "No agy running", "signed out", and "unreadable response" are now three distinct outcomes instead of one Gemini-flavoured Token refresh failed.
  • Antigravity visibility no longer requires geminiCliOAuthEnabled. It is gated on the checked status item (which itself requires agy on PATH), and hides when discovery reports no running language server — agy is a per-session CLI, not a daemon, so "installed but idle" must not pin a dead warning bar.
  • antigravity-usage-mirror.ts and its tests are deleted.

Gemini CLI usage is left completely intact. Removing it is a separable migration across persisted settings, telemetry, localization, and mobile/web projections, and Gemini CLI remains documented for Workspace/Enterprise, API-key, and Vertex users.

Why

In service.ts the Antigravity entry was literally { ...gemini, provider: 'antigravity' }. That produced two independent failures:

  1. Wrong data when it worked. fetchGeminiRateLimits calls cloudcode-pa.googleapis.com/v1internal:retrieveUserQuota with ideType: "GEMINI_CLI", so the segment rendered Gemini Code Assist per-model buckets under an Antigravity label. A user checking whether they were near their Antigravity weekly limit got a number unrelated to it.
  2. Refresh depended on a Gemini CLI install. Token refresh regex-extracts OAuth client credentials out of an installed @google/gemini-cli package. Antigravity users have no reason to have one, so the segment showed a refresh failure indefinitely.

Fixing only (2) makes things worse, not better: a visible warning becomes confident numbers from the wrong product. The data source itself had to change.

The LanguageServer is the right authority: it is the process that holds the live account, it needs no credentials from Orca, and it answers with exactly the bucket identities the issue describes.

Linked Issue

Fixes #9122

Supersedes the Agy-quota direction explored in #11536, #14571, #15948, #16653 and #12095. Differences from those, briefly:

This PR
Discovery pid + both ports read straight from agy's own startup log lines; no lsof/ps/process table, no CSRF token, no command-line inspection
Transport plaintext loopback preferred, self-signed TLS only as fallback
Stale accounts newest live run wins, with dead-pid filtering
Gemini usage preserved
Size 6 new files, 3 touched source files

agy -p /usage (the shell-out route taken by #15948 and #16653) was evaluated and not used: on the current agy 1.1.21 the literal output labels those PRs parse (Five Hour Limit Remaining, Weekly Limit Remaining, Gemini Models, Claude and GPT models) do not appear anywhere in the binary, print mode explicitly refuses some slash commands (/%s is not available in print mode), and a full CLI turn costs seconds per poll. The LanguageServer RPC is present in the binary 110 times and answered live here.

Visual Proof

N/A for a before/after of populated bars — this machine has no signed-in Antigravity account, so the happy-path segment cannot be rendered locally. No layout or interaction component changed: the existing named-bucket renderer in tooltip.tsx / UsageRosterPanel.tsx already renders buckets generically, and this change only populates ProviderRateLimits differently.

Testing

Verified live against a real agy 1.1.21 on macOS arm64:

  • Discovery, end to end: with one agy running, the log walk returned exactly {pid: 14672, HTTPS: 55703, HTTP: 55704} — the spawned pid, both ports — and lsof -nP -p <pid> -iTCP -sTCP:LISTEN independently confirmed the same two ports.
  • Transport, end to end: POST /exa.language_server_pb.LanguageServerService/RetrieveUserQuotaSummary with connect-protocol-version: 1 and body {} to the discovered plaintext port returned the real signed-out payload, which the fetcher maps to unavailable / missing-credentials. The same request over the TLS port returns the same payload.
  • Liveness filtering: after the process exits, discovery correctly returns nothing rather than reusing the stale log.
  • The response-shape fixtures come from the QuotaSummaryGroup / QuotaSummaryBucket proto descriptors embedded in the agy 1.1.21 binary (bucket_id, display_name, window, remaining_fraction, disabled, reset_time), not from guesswork. The signed-in 200 payload is the one leg that could not be exercised live here, for lack of an Antigravity account.

Automated:

  • pnpm test src/main/rate-limits/ src/renderer/src/components/status-bar/ — 91 files, 767 tests passed.

  • pnpm test src/main/rate-limits/ src/renderer/src/components/settings/ src/renderer/src/hooks/useIpcEvents-rate-limit-hydration.test.ts src/shared/ — 772 files, 7,572 tests passed, 66 skipped by existing conditions.

  • pnpm tc — clean.

  • oxlint --type-aware on every changed file — clean. Pre-commit oxlint, React Doctor, and oxfmt gates passed.

  • New coverage: log-banner parsing against a verbatim real log head (including that for HTTPS (gRPC) must not be read as the HTTP port), newest-first ordering, dead-pid filtering, log rotation, all four buckets with independent resets, disabled-bucket handling, most-constrained summarisation, plaintext-before-TLS ordering, TLS fallback, the three distinct failure outcomes, and that a signed-out newest server is never overridden by an older one's stale quota.

  • Rewrote service-antigravity-usage.test.ts around the real contract: the mirror-era assertions ("keeps mirroring a successful Gemini read") were the bug, so they are replaced with tests that fail on the pre-fix code — Antigravity must report its own number while Gemini reports 42, and must stay healthy while the Gemini fetch is erroring.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Platforms exercised: macOS arm64. Linux/Windows are code-reviewed only — discovery uses node:fs and node:path with no platform-specific commands, so there is no lsof/ps/PowerShell path to diverge.

Review

  • Security: requests are fixed to 127.0.0.1 and one constant RPC path; the self-signed exception can only ever apply to loopback and is not used at all when the plaintext port is reachable. Responses are capped at 1 MiB, requests at 2.5s. No credential, keychain, or token is read, written, or refreshed. Log reads are bounded to an 8 KiB head over at most 12 candidate files.
  • Cross-platform: no lsof, ps, where, or PowerShell. Paths are built with path.join on os.homedir().
  • SSH/remote: discovery is deliberately host-local, matching where the loopback ports actually are. An agy running only inside an SSH or WSL runtime is not reached; that reports as "not running" rather than as an error, and is called out as follow-up rather than silently mis-attributed.
  • Performance: at most 12 bounded head reads and one request per poll; no process spawned, no CLI turn, no token spent.
  • Backwards compatibility: Antigravity failure is provider-isolated. Gemini usage, its settings, telemetry, and localization are untouched. No wire or persisted-shape change — buckets and usageMetadata are existing optional fields on ProviderRateLimits.
  • Mobile: no surface or protocol change.

Agent skill upstream boundary

  • Not applicable.

Notes

Follow-ups deliberately left out of scope: reaching an agy that runs only inside an SSH/WSL runtime, reading the Antigravity desktop app's language server in addition to the CLI's, and the separable question of retiring the Gemini CLI usage provider.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Author

  • X / Twitter: @BrennanKB5

The Antigravity rate-limit entry was `{ ...gemini, provider: 'antigravity' }`,
so the segment reported Gemini Code Assist per-model quota under an Antigravity
label, and its refresh inherited Gemini CLI's credential plumbing — leaving
Antigravity-only users with a permanently failing segment.

Antigravity now answers for itself. Every `agy` run records its own pid and both
loopback ports in the first lines of its CLI log, so Orca discovers the newest
live language server from `~/.gemini/antigravity-cli/log`, asks it for
`RetrieveUserQuotaSummary`, and publishes the four native buckets (Gemini and
Claude/GPT, five-hour and weekly) with their independent resets.

- Newest run first: a long-lived `agy` keeps the account it started with across
  a sign-out, so an older process answers with a stale account's quota.
- Plaintext loopback port first, so the common path needs no TLS exception.
- "No `agy` running", "signed out", and "unreadable" are now distinct outcomes;
  only the actionable ones render a segment.
- Antigravity visibility no longer requires the Gemini CLI OAuth opt-in.

Fixes #9122
A signed-out answer from the newest `agy` used to fall through to an older
process, which still holds the account it started with — so Orca could render a
stale account's quota with nothing to indicate it. The newest live run now
settles the question; older servers are only consulted when the newest could not
be reached at all, which teaches nothing about the account.
@coderabbitai

coderabbitai Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 40384884-57fc-4cf6-bb9e-4bfd5f2cd294

📥 Commits

Reviewing files that changed from the base of the PR and between 42757cf and 8868dee.

📒 Files selected for processing (2)
  • src/main/wsl/wsl-guest-environment.test.ts
  • src/main/wsl/wsl-guest-environment.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

Adds native Antigravity quota discovery from local language-server logs. Adds quota parsing and HTTP or HTTPS fetching with timeout, response-size, abort, authentication, server, network, and parse handling. Runs Antigravity fetching independently in RateLimitService. Adds WSL probing with cancellation and process-group termination support. Removes Gemini-based mirroring. Updates provider visibility and settings so Antigravity does not require Gemini OAuth. Updates related tests and mocks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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. Analyzed 45 functions across 34 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes satisfy issue #9122 by fetching Antigravity quota independently from the Agy LanguageServer, removing the Gemini CLI dependency, preserving Gemini usage, and distinguishing unavailable, si…
Out of Scope Changes check ✅ Passed The changes remain aligned with the linked issue. Discovery, transport, WSL cancellation, visibility updates, native bucket rendering, mocks, and mirror removal support the independent Antigravity usa…
Title check ✅ Passed The title clearly and concisely identifies the main change: Antigravity quota is read from Agy instead of the Gemini mirror.
Description check ✅ Passed The description is complete and closely follows the repository template. It explains the change and rationale, links issue #9122, documents testing and platform coverage, provides visual-proof rationa…
Full details: Linked Issues check

Explanation

The changes satisfy issue #9122 by fetching Antigravity quota independently from the Agy LanguageServer, removing the Gemini CLI dependency, preserving Gemini usage, and distinguishing unavailable, signed-out, and unreadable states.

Full details: Out of Scope Changes check

Explanation

The changes remain aligned with the linked issue. Discovery, transport, WSL cancellation, visibility updates, native bucket rendering, mocks, and mirror removal support the independent Antigravity usage flow and its required runtime behavior.

Full details: Description check

Explanation

The description is complete and closely follows the repository template. It explains the change and rationale, links issue #9122, documents testing and platform coverage, provides visual-proof rationale, and addresses security, compatibility, performance, and scope.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a48557cf-5318-4961-b841-3183324a90fe

📥 Commits

Reviewing files that changed from the base of the PR and between d60a3c9 and f645556.

📒 Files selected for processing (20)
  • src/main/rate-limits/antigravity-language-server-log.test.ts
  • src/main/rate-limits/antigravity-language-server-log.ts
  • src/main/rate-limits/antigravity-quota-summary.test.ts
  • src/main/rate-limits/antigravity-quota-summary.ts
  • src/main/rate-limits/antigravity-usage-fetcher.test.ts
  • src/main/rate-limits/antigravity-usage-fetcher.ts
  • src/main/rate-limits/antigravity-usage-mirror.test.ts
  • src/main/rate-limits/antigravity-usage-mirror.ts
  • src/main/rate-limits/rate-limit-service-test-harness.ts
  • src/main/rate-limits/service-account-target-selection.test.ts
  • src/main/rate-limits/service-antigravity-usage.test.ts
  • src/main/rate-limits/service-inactive-account-previews.test.ts
  • src/main/rate-limits/service-live-claude-usage.test.ts
  • src/main/rate-limits/service-minimax-usage.test.ts
  • src/main/rate-limits/service-refresh-orchestration.test.ts
  • src/main/rate-limits/service-window-activation.test.ts
  • src/main/rate-limits/service.ts
  • src/renderer/src/components/status-bar/StatusBar.tsx
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.test.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.ts
💤 Files with no reviewable changes (3)
  • src/main/rate-limits/antigravity-usage-mirror.test.ts
  • src/renderer/src/components/status-bar/StatusBar.tsx
  • src/main/rate-limits/antigravity-usage-mirror.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.

Comment thread src/main/rate-limits/antigravity-usage-fetcher.ts Outdated
Comment thread src/main/rate-limits/service.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 76d14c2f-dbde-4f47-98d9-673d5e0263f8

📥 Commits

Reviewing files that changed from the base of the PR and between f645556 and 56c95ff.

📒 Files selected for processing (2)
  • src/main/rate-limits/antigravity-usage-fetcher.test.ts
  • src/main/rate-limits/antigravity-usage-fetcher.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.

Comment thread src/main/rate-limits/antigravity-usage-fetcher.ts Outdated
A newer Agy server response now settles quota lookup instead of falling through to an older account, and loopback abort listeners are released after settlement. The usage roster no longer duplicates the derived weekly summary or routes Antigravity sign-in to Gemini settings.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f3554945-d85e-4675-866f-1860ccd2f62e

📥 Commits

Reviewing files that changed from the base of the PR and between 56c95ff and 45e7db1.

📒 Files selected for processing (8)
  • src/main/rate-limits/antigravity-usage-fetcher.test.ts
  • src/main/rate-limits/antigravity-usage-fetcher.ts
  • src/renderer/src/components/status-bar/UsageRosterPanel.tsx
  • src/renderer/src/components/status-bar/tooltip.test.ts
  • src/renderer/src/components/status-bar/tooltip.tsx
  • src/renderer/src/components/status-bar/usage-provider-settings-target.test.ts
  • src/renderer/src/components/status-bar/usage-provider-settings-target.ts
  • src/shared/rate-limit-types.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.

Comment thread src/main/rate-limits/antigravity-usage-fetcher.ts Outdated
@brennanb2025

brennanb2025 commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Final exact-head review — b719a3c55f34182614b0c3a2270b5bf2a559d5be

Resolved the three current review findings with focused production fixes and regression coverage:

  • Runtime-policy transitions now refresh Antigravity and clear the previous snapshot.
  • Each fetch cycle captures its target and generation, rejecting stale and ABA results before publication.
  • WSL discovery validates /proc/<pid>/comm and process start time against the log timestamp, rejecting PID reuse.

All eight PR review threads are resolved. A fresh independent review-code pass reported no issues. The resulting work remains bounded and compatible with local, folder-workspace, WSL, SSH/execution-host, mixed-version remote-wire, cross-platform, and generic provider boundaries; no wire contract changed.

Verification passed:

  • pnpm test src/main/rate-limits — 48 files, 491 tests.
  • pnpm tc.
  • Default and type-aware oxlint on all six changed files.
  • oxfmt --check and git diff --check.

CI run 33065989210 tested merge ref 4445c8fa949657d3a04555e021594d7094d7f7d8 (base 026389a3bc03da03ca2d65295e805493712b0774, head b719a3c55f34182614b0c3a2270b5bf2a559d5be). The failed-job rerun confirmed Node 24 and Node 26 shard 10/16 deterministically fail only src/shared/runtime-client-export-parity.test.ts, expecting three terminal exports absent from the base parity list; the test and relevant runtime-types source are byte-identical between base and merge ref. The initially timed-out Node 24 browser/WebRTC shard passed on rerun, confirming that failure was transient. All other checks pass, but aggregate verify remains red.

Verdict: the focused review fixes are clean, but the PR is MERGEABLE / UNSTABLE and not merge-ready while required CI remains red. No merge was attempted.

@brennanb2025

brennanb2025 commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor Author

QA/evidence for exact head b719a3c55f34182614b0c3a2270b5bf2a559d5be

No renderer/UI surface changed in the six-file review fix, so visual proof of those lifecycle and process-identity changes is not applicable. Regression coverage proves runtime-policy refresh and snapshot clearing, stale/ABA fetch rejection, and WSL PID identity/start-time validation; the full 491-test rate-limit suite, typecheck, lint, format, and diff checks pass.

Live signed-in Antigravity/provider QA is blocked. Antigravity CLI agy 1.1.22 was launched through its normal flow and explicitly reported: “You are currently not signed in.” Because no safe signed-in credentials are available, no truthful quota flow or genuine visual screenshot can be captured; readiness is not inferred or fabricated. Electron desktop automation was not substituted, and mobile QA does not apply.

Contributor provenance was rechecked: contributor commit 6be015cc… by TaehyunKim3 has patch ID bb8dd52cb926567c43765faa28e423a7fcb7b86c, matching a402f46d…. The existing concise thank-you remains truthful and was preserved without duplication: #16710 (comment)

Exact-head CI run 33065989210 remains red only on deterministic base/merge-ref runtime export parity failures in Node 24 and Node 26 shard 10/16 plus aggregate verify; the transient browser/WebRTC shard passed on rerun. GitHub reports MERGEABLE / UNSTABLE, so this remains not merge-ready and no merge was attempted.

@taehyunkim3

taehyunkim3 commented Aug 27, 2026 •

Copy link
Copy Markdown

I tested this against a live agy 1.1.21 quota response. The actual payload wraps quota groups under response.groups, while the current parser only reads top-level buckets, so signed-in usage can parse as empty.

Minimal follow-up commit, based exactly on this PR's current head 45e7db1b:
taehyunkim3@a402f46

It adds response.groups support and preserves top-level buckets compatibility.

Verification:

  • regression test failed 5/9 before the parser change, then passed 9/9
  • pnpm tc
  • changed-code quality gate: 0 new findings
  • git diff --check

Cherry-pick: a402f46d9923939410c9ccb9b905965d913c2b8c

image

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Thanks @taehyunkim3 — confirmed this is based on exact head 45e7db1bbd2431685dc843e97d1a5df331575f69, adds response.groups parsing while preserving top-level buckets compatibility, and passes the focused 9-test parser suite, pnpm tc, oxlint, and git diff --check.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Verdict for head 45e7db1bbd2431685dc843e97d1a5df331575f69: not ready to merge yet. GitHub reports OPEN / MERGEABLE / CLEAN with 47 successful checks and 1 skipped E2E, but two CodeRabbit review threads remain unresolved on this head: SSH/WSL execution-host routing and oversized-response promise settlement; existing QA also records live signed-in Antigravity validation as blocked.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Final review verification — 42757cf749f21ce0c6f547477e1a092cbe1c0181

Three adversarial review/fix rounds covered response settlement, bounded WSL streaming, cached-probe cancellation, subprocess and listener cleanup, default-distro process-group identity, provider neutrality, and host/WSL execution boundaries. No in-scope findings remain; both previously unresolved review threads are replied to and resolved.

Local verification:

  • pnpm test src/main/rate-limits/ src/main/wsl/wsl-guest-environment.test.ts src/main/wsl/wsl-runner.test.ts src/main/git/wsl-process-group-termination.test.ts — 51 files, 549 tests passed
  • pnpm tc — passed
  • touched-file oxlint and oxfmt --check — passed
  • git diff --check — passed

Exact-head CI completed with 44 successful checks and 1 skipped E2E. tests node 24 10/16 and tests node 26 10/16 fail the same pre-existing src/shared/runtime-client-export-parity.test.ts expectation from current origin/main (new terminal degradation exports are present but absent from the base expectation); the aggregate verify check therefore also fails. This PR does not change that contract or test, so no unrelated parity edit was added.

Review verdict: the focused implementation is clean, but the PR is not yet merge-ready because exact-head CI is red from the base-branch parity mismatch and live signed-in Antigravity validation remains unavailable.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (1)
src/main/rate-limits/antigravity-usage-fetcher.test.ts (1)

74-77: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove the as never cast. The object already matches AntigravityUsageFetchOptions (target plus logSource), and the sibling test at Line 103 calls the same function without a cast. The cast hides future changes to the target shape from type checking.

♻️ Proposed change
     const limits = await fetchAntigravityRateLimits({
       target: { runtime: 'wsl', wslDistro: 'Ubuntu' },
       logSource: runningServers({})
-    } as never)
+    })

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a0373b29-7264-4c1d-b8ac-c2bfd6f5d86c

📥 Commits

Reviewing files that changed from the base of the PR and between 45e7db1 and 42757cf.

📒 Files selected for processing (17)
  • src/main/git/wsl-process-group-termination.test.ts
  • src/main/git/wsl-process-group-termination.ts
  • src/main/index.ts
  • src/main/rate-limits/account-runtime-target-sync.test.ts
  • src/main/rate-limits/account-runtime-target-sync.ts
  • src/main/rate-limits/antigravity-quota-summary.test.ts
  • src/main/rate-limits/antigravity-quota-summary.ts
  • src/main/rate-limits/antigravity-usage-fetcher.test.ts
  • src/main/rate-limits/antigravity-usage-fetcher.ts
  • src/main/rate-limits/antigravity-wsl-usage-probe.test.ts
  • src/main/rate-limits/antigravity-wsl-usage-probe.ts
  • src/main/rate-limits/service-antigravity-usage.test.ts
  • src/main/rate-limits/service.ts
  • src/main/wsl/wsl-guest-environment.test.ts
  • src/main/wsl/wsl-guest-environment.ts
  • src/main/wsl/wsl-runner.test.ts
  • src/main/wsl/wsl-runner.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review.

Comment thread src/main/rate-limits/account-runtime-target-sync.ts Outdated
Comment thread src/main/rate-limits/antigravity-wsl-usage-probe.ts
Comment thread src/main/rate-limits/service.ts
Comment thread src/main/wsl/wsl-guest-environment.ts
@brennanb2025

brennanb2025 commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Exact-head review verification

Reviewed live PR head b719a3c55f34182614b0c3a2270b5bf2a559d5be against live origin/main (026389a3bc03da03ca2d65295e805493712b0774; merge base d60a3c900b0cfe63611a6f0a2ab0e41cc438939d), including all production/test changes, resolved review threads, host/WSL cancellation and process-lifecycle boundaries, SSH/folder-workspace impact, Windows/Linux behavior, and bounded refresh/performance behavior. I found no proven in-scope product defect and made no code changes.

Local verification passed: 54 focused files / 629 tests, pnpm tc, changed-code quality (all three scans), changed-file oxfmt --check, and git diff --check. The current GitHub run is still UNSTABLE: Node 24 and 26 shard 10/16 fail only src/shared/runtime-client-export-parity.test.ts, with aggregate verify failing (run); current main already removes the three stale terminal exports, and a merge-tree takes that exact main blob with no conflict, but exact-head CI correctly remains red until the branch itself is refreshed.

Merge verdict: do not merge yet; refresh the branch from current main and obtain a green exact-head run first.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

QA / evidence

Validated exact head b719a3c55f34182614b0c3a2270b5bf2a559d5be in its own Orca dev instance via Playwright CDP. App identity reported the expected worktree (pr-16710-fix-review-r1), and the real status-bar Usage menu opened and rendered the Antigravity row during refresh without clipping, overlap, or theme/z-order regressions:

Exact-head Orca Usage menu during Antigravity refresh

Authenticated four-bucket happy-path QA is truthfully blocked on this host: agy is installed, but there is no running Antigravity language server or readable language-server log source, and a real refresh resolves rateLimits.antigravity to null. I did not fabricate quota state or use desktop/accessibility automation; parser, native endpoint, cancellation, WSL probe, and four-bucket behavior are covered by the passing focused suites, but a signed-in live Agy session remains required for end-to-end quota proof.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

QA / evidence — exact head 9d245c2f6e3aa58cdc5fde2016c235c83c6f45db

This supersedes the earlier blocked-QA note at #16710 (comment).

Agy is reachable but not authenticated on this machine. agy --version reports 1.1.22; the newest language-server log records PID 31739, HTTPS port 60275, and the second/plain-HTTP port 60276, then immediately reports: “You are not logged into Antigravity.” No token or credential material was read or printed.

Brennan can unblock the live quota screenshot in one pass:

agy

Complete the browser sign-in that opens, then return to the terminal. Success is the Agy TUI advancing past “Signing in…” into its setup/main UI and a subsequent language-server log no longer reporting “You are not logged into Antigravity.”

Because the provider is currently signed out, I did not fabricate quota state or capture a misleading screenshot. The authenticated Antigravity-from-Agy screenshot gap therefore remains open and should be rerun after Brennan completes the command above.

@isairz

isairz commented Aug 28, 2026 •

Copy link
Copy Markdown

I found one small UI gap while checking exact head 9d245c2f6e3aa58cdc5fde2016c235c83c6f45db: compact summaries select the tightest Antigravity pool, but the named-bucket label wins before resetsAt is considered. That shows the long pool name instead of the live reset countdown used by the existing compact-chip behavior.

I prepared a focused follow-up commit based directly on that head:

isairz@6236084

  • Uses reset duration only for Antigravity compact summaries; other named providers keep their bucket labels.
  • Adds rendered coverage for all four pools in Detailed mode, the tightest pool in Compact + Remaining mode, and the compact status-bar chip.
  • Verified: 2 test files / 20 tests, pnpm typecheck, changed-code quality (0 findings), type-aware oxlint, React Doctor, oxfmt, and git diff --check.

Cherry-pick: 623608451695f799a3b3550e7e23770256cdd7dc

@Tauri-EPO

Copy link
Copy Markdown
Contributor

Windows evidence for the language-server route, since none of the Agy-quota PRs has been exercised there yet.

Environment: Windows 11, Orca 1.4.198, agy 1.1.27, Google AI Pro account (paidTier: g1-pro-tier), 2026-09-08.

  1. The local language server answers RetrieveUserQuotaSummary with
    HTTP 500 {"code":"internal","message":"internal: failed to get load code assist response: error getting token source: You are not logged into Antigravity."}
    while the same agy process completes turns normally (status: SUCCESS). My own interactive sessions from 09-06, 09-07 and 09-08 log the same "You are not logged into Antigravity" 38–62 times each. On this setup the fetcher would settle on "signed out" for a signed-in user. Reproduced on 2 live probes plus 3 prior session logs.

  2. On Windows, agy 1.1.27 keeps its token in Credential Manager (generic entry gemini:antigravity), plain JSON: {"token":{"access_token","refresh_token","token_type","expiry"},"auth_method":"consumer"}. There is no ~/.gemini/antigravity-cli/antigravity-oauth-token file (0 references to that name in the binary), so the file-based readers in fix(usage): read Antigravity quota from its own credential, including SSH hosts #19209 / feat(accounts): show Antigravity CLI sign-in and usage #19588 would report "missing" here.

  3. With that token, cloudcode-pa loadCodeAssist (ideType: ANTIGRAVITY) returns project aicode-consumers, and retrieveUserQuotaSummary {project} returns 200 with both groups × both windows (gemini-weekly 94.85 % left, gemini-5h / 3p-weekly / 3p-5h 100 %). User-Agent made no difference.

  4. The Gemini CLI token from ~/.gemini/oauth_creds.json gets 403 PERMISSION_DENIED on retrieveUserQuotaSummary even with ideType: ANTIGRAVITY, so it cannot be reused.

Happy to run any of these again against a branch if useful.

@abruption

Copy link
Copy Markdown
Contributor

@brennanb2025, following up on @Tauri-EPO's Windows evidence: #19209 implements the credential-backed Cloud Code path that avoids depending on the Language Server's authentication state.

It was validated end to end with a refreshed Antigravity token on an Ampere KR host, including the caller-identity requirement and all four native quota windows. It also discovers the credential through Orca's existing filesystem routing on connected SSH hosts, which complements this PR's local/WSL Language Server path.

I do not think #19209 should replace the Language Server happy path. Its narrow credential discovery and API request code could serve as a fallback when the server reports signed out for a working Agy session, or when Agy runs on an SSH execution host.

Follow-up validation found two points to tighten before reuse: do not attach credentialSource until a credential is actually observed, and preserve unverifiable when an SSH provider is unavailable. Its Gemini mirror fallback should also be dropped if integrated with this PR's independent Antigravity flow.

@nwparker

Copy link
Copy Markdown
Contributor

Independent review (2026-09-20):

The current installed agy 1.2.7 does answer a harmless /usage print probe, but this PR targets the older 1.1.21 language-server log/loopback contract. The active migration stack now has the version-gated CLI quota implementation in #21654 and configured-executable/visibility follow-up in #21678, with current live evidence and full CI.

Verdict: do not merge this PR as-is; superseded by #21654 → #21678. No code changes made here.

This branch has not been deployed

No deployments
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.

[Bug]: Antigravity usage is a copy of the Gemini quota — wrong pools, and refresh breaks entirely without a local Gemini CLI install

6 participants