Skip to content

fix(usage): show Antigravity quotas from Agy - #11536

Closed
isairz wants to merge 15 commits into
stablyai:mainfrom
isairz:isairz/agy-usage
Closed

isairz wants to merge 15 commits into
stablyai:mainfrom
isairz:isairz/agy-usage

Conversation

@isairz

@isairz isairz commented Jul 30, 2026 •

Copy link
Copy Markdown

Summary

  • Migrate Orca's deprecated Gemini usage integration to the active local Agy LanguageServer, making Antigravity the quota source.
  • Preserve all four Agy quota identities: Gemini 5h, Gemini wk, Claude/GPT 5h, and Claude/GPT wk.
  • Show all four buckets in Detailed view while Compact and the status bar use the tightest bucket/reset countdown, honoring the shared Used/Remaining preference.
  • Remove the migrated Gemini usage provider, OAuth path, settings, persisted status item, telemetry field, UI copy, and localization remnants while preserving Gemini agent support.

Screenshots

Antigravity in Detailed mode (Used). All four Agy buckets are visible, with the same provider also present in the status bar below.

Antigravity Detailed usage showing Gemini and Claude/GPT five-hour and weekly quotas

Display option Gemini Claude/GPT
Used 5h 0%, wk 3% 5h 0%, wk 0%
Remaining 5h 100%, wk 97% 5h 100%, wk 100%

Detailed view preserves the independent Gemini and Claude/GPT five-hour and weekly buckets. Compact view selects the most constrained bucket without losing its reset time.

Related issues

#14571 explores the same host-local quota source with a provider-preserving approach. This PR follows a migration-focused approach because the Gemini CLI usage integration is deprecated: it carries existing preferences and persisted state forward to Agy and removes the migrated Gemini usage-specific paths, while leaving Gemini agent support unchanged.

Testing

  • Node 24 pnpm typecheck
  • Full suite on current main — 6,696 files and 62,509 tests passed; 42 files and 254 tests skipped by their existing conditions
  • Full pnpm build, including desktop, web, CLI, relay, and macOS native builds
  • 21 affected Vitest files — 268 tests passed
  • Full pnpm lint, including reliability gates, max-lines ratchet, bundled-skill checks, and localization checks
  • Changed-code quality — oxlint, type-aware oxlint, and React Doctor: 0 findings across 32 changed code files
  • Changed-scope oxfmt and whitespace validation
  • Added regression coverage for Agy endpoint discovery, all four quota buckets, provider isolation, persistence migration, visibility, and Detailed/Compact Used/Remaining rendering
  • Live Electron manual validation against the active Agy quota service, including all four buckets and the status bar summary

Security audit

  • No hardcoded credentials or secrets were added.
  • Local process inspection uses the shared runProcess wrapper with fixed commands and argument arrays, without shell interpolation.
  • Quota requests are restricted to 127.0.0.1 and a fixed LanguageServer RPC path.
  • A CSRF token is included when discovered from the Antigravity LanguageServer command line.
  • Deprecated Gemini OAuth credential extraction and fallback code is deleted.
  • Responses are strictly parsed and only known Agy bucket identities are accepted.

Notes

  • This removes Gemini CLI usage and OAuth tracking, not Gemini agent support.
  • Agy quota discovery is host-local. It does not retrieve quota from an Agy process running exclusively inside another SSH, WSL, or remote runtime without a locally reachable Agy LanguageServer.
  • Windows skips lsof/ps discovery and relies on Agy logs; paths use Node path APIs.

Read quota windows from the active Agy LanguageServer so Orca mirrors Antigravity's five-hour and weekly usage, and retire the deprecated Gemini CLI OAuth path.

Constraint: Agy quota is exposed by a host-local LanguageServer, not a supported remote account API

Rejected: Keep the deprecated Gemini OAuth fallback | it preserves ambiguous and divergent quota semantics

Confidence: high

Scope-risk: moderate

Directive: Keep Gemini agent support separate from Gemini usage-provider state

Tested: 934 targeted tests; pnpm typecheck; pnpm build; changed-file oxlint and oxfmt; localization checks; live used and remaining UI validation

Not-tested: Full pnpm test and pnpm lint remain blocked by pre-existing local relay environment and daemon max-lines failures
@isairz
isairz requested a review from brennanb2025 as a code owner July 30, 2026 09:05
Comment thread src/main/rate-limits/antigravity-usage-fetcher.ts Outdated
@greptile-apps

greptile-apps Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR replaces the deprecated Gemini CLI OAuth usage path with a direct local Agy (antigravity-cli) LanguageServer quota fetch, making Antigravity a first-class provider independent of Gemini credentials.

  • New antigravity-usage-fetcher: discovers the Agy LanguageServer endpoint via log-file parsing and lsof/ps, calls /RetrieveUserQuotaSummary over localhost with optional CSRF, and maps the Gemini Models bucket group to Orca's 5-hour and weekly windows.
  • Deprecated Gemini usage provider removed: gemini is excised from the provider union, RateLimitState, service state, status-bar UI, and all i18n strings; geminiCliOAuthEnabled is stripped from persisted settings on load and write.
  • Migration helpers added: renderer strips gemini from stored statusBarItems and re-persists; persistence layer strips geminiCliOAuthEnabled and marks loadNeedsSave so the deprecated key is cleaned up on next flush.

Confidence Score: 5/5

Safe to merge; the new Agy discovery path is well-tested and the deprecated Gemini cleanup is complete across types, service, UI, and persistence.

The change is a clean replacement of one fetch path with another. Both discovery strategies (log files and lsof) have individual error guards, deduplication correctly prefers CSRF-bearing entries, and two-level migrations (persistence + renderer UI slice) cover all persisted state. The sole resilience gap — a mid-loop file-read exception discarding already-found log endpoints — is a minor edge case with a low-impact effect on a single refresh cycle and an easy fix.

Files Needing Attention: src/main/rate-limits/antigravity-usage-fetcher.ts — the sequential log-read loop in discoverLogEndpoints.

Important Files Changed

Filename Overview
src/main/rate-limits/antigravity-usage-fetcher.ts New Agy quota fetcher: discovers LanguageServer endpoints via log files and lsof, fetches /RetrieveUserQuotaSummary, maps Gemini model group to 5h/weekly windows. One minor resilience gap in the log-read loop.
src/main/rate-limits/antigravity-endpoint-selection.ts Parallel PID inspection and deduplication logic; correctly prefers CSRF-bearing entries over null-CSRF duplicates.
src/main/rate-limits/service.ts Replaces the mirrored Gemini→Antigravity snapshot with a direct fetchAntigravityRateLimits call; removes Gemini state tracking, resolver, and failure-streak entry cleanly.
src/main/persistence.ts Adds stripDeprecatedGeminiCliOAuthSetting applied on both load and write paths; sets loadNeedsSave to force a flush when the deprecated key is present.
src/renderer/src/store/slices/ui.ts Adds DEPRECATED_STATUS_BAR_ITEMS set to strip gemini from persisted status bar lists; statusBarItemsMigrated flag correctly triggers a re-persist when items change.
src/renderer/src/components/status-bar/status-bar-provider-visibility.ts Removes geminiCliOAuthEnabled dependency from Antigravity visibility; antigravityUsageConfigured alone is now the durable signal.
src/renderer/src/components/status-bar/tooltip.tsx getWindowSections now conditionally appends the Weekly row only when p.weekly is non-null.
src/shared/rate-limit-types.ts Removes gemini from the ProviderRateLimits provider union and RateLimitState.
src/main/rate-limits/antigravity-usage-fetcher.test.ts Comprehensive tests for log parsing, lsof parsing, CSRF extraction, deduplication, quota mapping, and network fallback.

Sequence Diagram

sequenceDiagram
    participant S as RateLimitService
    participant F as fetchAntigravityRateLimits
    participant LD as discoverLogEndpoints
    participant LO as discoverLsofEndpoints
    participant DD as deduplicateAgyQuotaEndpoints
    participant Net as net.fetch (127.0.0.1)

    S->>F: fetchAntigravityRateLimits()
    F->>LD: discoverLogEndpoints()
    LD-->>F: "[{pid, port, csrfToken:null}, ...]"
    F->>LO: discoverLsofEndpoints()
    LO->>LO: lsof -nP -iTCP -sTCP:LISTEN -F pcn
    LO->>LO: "ps -p PID -o command= (parallel, Promise.all)"
    LO-->>F: "[{pid, port, csrfToken:"token"}, ...]"
    F->>DD: deduplicateAgyQuotaEndpoints([log..., lsof...])
    Note over DD: prefer csrfToken entry for same pid:port key
    DD-->>F: unique endpoints
    loop for each endpoint
        F->>Net: POST /RetrieveUserQuotaSummary
        Net-->>F: quota JSON or null
        F->>F: "parseAgyQuotaSummary → {session, weekly}"
    end
    F-->>S: ProviderRateLimits (ok / error / unavailable)
Loading

Reviews (3): Last reviewed commit: "Preserve valid Antigravity quota endpoin..." | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Jul 30, 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: 43e5e410-20cd-45ab-bc2c-cc52966480c2

📥 Commits

Reviewing files that changed from the base of the PR and between 3d74f5f and 80579dae588affcfac34b4f7593697da887f7e81.

📒 Files selected for processing (73)
  • mobile/src/components/accounts-snapshot.ts
  • src/main/codex-accounts/runtime-home-settings-test-fixtures.ts
  • src/main/codex-accounts/service-reset-credit-test-fixtures.ts
  • src/main/codex-accounts/service-test-harness.ts
  • src/main/index.ts
  • src/main/persistence-initial-load.test.ts
  • src/main/persistence/applying-settings/terminal-settings-migrations.ts
  • src/main/persistence/loading-store/store.ts
  • src/main/rate-limits/antigravity-endpoint-selection.ts
  • src/main/rate-limits/antigravity-quota-parser.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/gemini-bucket-formatting.test.ts
  • src/main/rate-limits/gemini-bucket-formatting.ts
  • src/main/rate-limits/gemini-cli-oauth-extractor.ts
  • src/main/rate-limits/gemini-oauth-sources.ts
  • src/main/rate-limits/gemini-usage-fetcher.fallback.test.ts
  • src/main/rate-limits/gemini-usage-fetcher.test-fixtures.ts
  • src/main/rate-limits/gemini-usage-fetcher.test.ts
  • src/main/rate-limits/gemini-usage-fetcher.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/main/runtime/rpc/methods/client-ui-schemas.ts
  • src/renderer/src/components/settings/AccountsPane.test.tsx
  • src/renderer/src/components/settings/AccountsPane.tsx
  • src/renderer/src/components/settings/AppearanceWindowSidebarSection.tsx
  • src/renderer/src/components/settings/accounts-search.ts
  • src/renderer/src/components/settings/appearance-status-bar-search.ts
  • src/renderer/src/components/stats/GrokUsagePane.test.tsx
  • src/renderer/src/components/status-bar/StatusBar.tsx
  • src/renderer/src/components/status-bar/StatusBarUsageEmptyCta.tsx
  • src/renderer/src/components/status-bar/UsageRosterPanel.test.tsx
  • src/renderer/src/components/status-bar/UsageRosterPanel.tsx
  • src/renderer/src/components/status-bar/provider-segment-monthly-window.test.tsx
  • src/renderer/src/components/status-bar/status-bar-agent-gating.test.ts
  • src/renderer/src/components/status-bar/status-bar-agent-gating.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.test.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.ts
  • src/renderer/src/components/status-bar/tooltip.test.ts
  • src/renderer/src/components/status-bar/tooltip.tsx
  • src/renderer/src/components/status-bar/usage-error-copy.test.ts
  • src/renderer/src/components/status-bar/usage-error-copy.ts
  • src/renderer/src/components/status-bar/usage-provider-settings-target.test.ts
  • src/renderer/src/components/status-bar/usage-provider-settings-target.ts
  • src/renderer/src/hooks/useIpcEvents-rate-limit-hydration.test.ts
  • src/renderer/src/hooks/useSettingsNavigationMetadata.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/i18n/zh-technical-literal-mistranslations.test.ts
  • src/renderer/src/store/slices/rate-limits.ts
  • src/renderer/src/store/slices/ui-hydration-workspace-preferences.test.ts
  • src/renderer/src/store/slices/ui.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/child-process/__fixtures__/child-process-import-allowlist.txt
  • src/shared/constants.ts
  • src/shared/global-settings-types.ts
  • src/shared/rate-limit-types.test.ts
  • src/shared/rate-limit-types.ts
  • src/shared/status-bar-defaults.ts
  • src/shared/telemetry-events.ts
  • src/shared/ui-chrome-types.ts
💤 Files with no reviewable changes (35)
  • src/renderer/src/store/slices/rate-limits.ts
  • src/shared/ui-chrome-types.ts
  • src/renderer/src/i18n/zh-technical-literal-mistranslations.test.ts
  • src/main/rate-limits/gemini-usage-fetcher.test-fixtures.ts
  • src/main/rate-limits/service-antigravity-usage.test.ts
  • src/renderer/src/components/settings/appearance-status-bar-search.ts
  • src/renderer/src/components/stats/GrokUsagePane.test.tsx
  • src/main/codex-accounts/runtime-home-settings-test-fixtures.ts
  • src/main/rate-limits/gemini-bucket-formatting.test.ts
  • src/main/rate-limits/antigravity-usage-mirror.test.ts
  • src/shared/child-process/fixtures/child-process-import-allowlist.txt
  • src/main/rate-limits/antigravity-usage-mirror.ts
  • src/shared/constants.ts
  • src/main/index.ts
  • src/shared/status-bar-defaults.ts
  • src/renderer/src/components/settings/accounts-search.ts
  • src/shared/rate-limit-types.test.ts
  • src/renderer/src/components/status-bar/usage-error-copy.test.ts
  • src/main/rate-limits/gemini-oauth-sources.ts
  • src/renderer/src/hooks/useIpcEvents-rate-limit-hydration.test.ts
  • src/renderer/src/components/settings/AppearanceWindowSidebarSection.tsx
  • src/main/rate-limits/gemini-usage-fetcher.test.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/main/codex-accounts/service-test-harness.ts
  • src/main/rate-limits/gemini-usage-fetcher.fallback.test.ts
  • src/shared/global-settings-types.ts
  • src/renderer/src/components/status-bar/usage-error-copy.ts
  • src/main/rate-limits/gemini-usage-fetcher.ts
  • src/main/rate-limits/gemini-cli-oauth-extractor.ts
  • src/main/runtime/rpc/methods/client-ui-schemas.ts
  • src/main/rate-limits/gemini-bucket-formatting.ts
  • src/main/codex-accounts/service-reset-credit-test-fixtures.ts
  • src/shared/telemetry-events.ts
  • src/renderer/src/components/status-bar/status-bar-agent-gating.test.ts
  • src/renderer/src/components/settings/AccountsPane.test.tsx
🚧 Files skipped from review as they are similar to previous changes (37)
  • src/main/rate-limits/service-account-target-selection.test.ts
  • src/main/persistence/applying-settings/terminal-settings-migrations.ts
  • src/main/persistence-initial-load.test.ts
  • src/main/rate-limits/service-live-claude-usage.test.ts
  • src/main/rate-limits/service-minimax-usage.test.ts
  • src/renderer/src/components/status-bar/UsageRosterPanel.tsx
  • src/renderer/src/hooks/useSettingsNavigationMetadata.ts
  • src/renderer/src/components/status-bar/status-bar-agent-gating.ts
  • src/main/rate-limits/service-window-activation.test.ts
  • src/main/rate-limits/service-inactive-account-previews.test.ts
  • mobile/src/components/accounts-snapshot.ts
  • src/renderer/src/components/status-bar/StatusBarUsageEmptyCta.tsx
  • src/renderer/src/components/status-bar/usage-provider-settings-target.test.ts
  • src/renderer/src/store/slices/ui-hydration-workspace-preferences.test.ts
  • src/main/rate-limits/rate-limit-service-test-harness.ts
  • src/renderer/src/store/slices/ui.ts
  • src/renderer/src/components/status-bar/usage-provider-settings-target.ts
  • src/renderer/src/i18n/locales/en.json
  • src/main/rate-limits/antigravity-quota-parser.ts
  • src/main/rate-limits/antigravity-endpoint-selection.ts
  • src/renderer/src/components/status-bar/provider-segment-monthly-window.test.tsx
  • src/renderer/src/components/status-bar/tooltip.tsx
  • src/main/rate-limits/antigravity-usage-fetcher.test.ts
  • src/renderer/src/components/status-bar/StatusBar.tsx
  • src/main/rate-limits/antigravity-usage-fetcher.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.ts
  • src/renderer/src/components/status-bar/tooltip.test.ts
  • src/renderer/src/components/status-bar/UsageRosterPanel.test.tsx
  • src/main/persistence/loading-store/store.ts
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.test.ts
  • src/renderer/src/i18n/locales/ko.json
  • src/shared/rate-limit-types.ts
  • src/renderer/src/i18n/locales/zh.json
  • src/main/rate-limits/service.ts
  • src/renderer/src/components/settings/AccountsPane.tsx
  • src/main/rate-limits/service-refresh-orchestration.test.ts

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


📝 Walkthrough

Walkthrough

Removes Gemini rate-limit fetching, OAuth configuration, shared state, status-bar support, settings, search entries, telemetry keys, and localized UI strings. Adds Antigravity endpoint discovery, CSRF handling, quota parsing, local service requests, retry behavior, and rate-limit integration. Updates persistence migrations to remove deprecated Gemini settings and status-bar items. Extends Antigravity status-bar rendering and service tests.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes independently fetch Agy quotas, preserve both quota pools, remove Gemini OAuth dependence, and implement Antigravity visibility coverage for issues [#9122] and [#7809].
Out of Scope Changes check ✅ Passed The changes remain focused on migrating Gemini usage to Antigravity, updating related UI and persistence state, and adding required regression coverage.
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
Title check ✅ Passed The title clearly and concisely describes the primary change: displaying Antigravity quotas from the local Agy service.
Description check ✅ Passed The description is detailed, on-topic, and covers the change, rationale, linked issues, visual proof, testing, security, and compatibility notes. It does not use every template heading and omits expli…
Full details: Description check

Explanation

The description is detailed, on-topic, and covers the change, rationale, linked issues, visual proof, testing, security, and compatibility notes. It does not use every template heading and omits explicit checklist, review, and AI disclosure sections, but the critical information is present.


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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/renderer/src/i18n/locales/ja.json (1)

3144-3202: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Remove the unreachable Gemini-specific locale entries from the catalogs.

"d2375976eb" and "68efc0345c" are no longer referenced by renderer code and ProviderRateLimits['provider'] no longer includes gemini, so these orphaned status-bar tooltips remain as unused localization remnants. Keep the Gemini agent/name entries that still apply to the Gemini CLI agent path, but prune the usage-provider strings and their counterparts in the locale files.

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

174-203: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Unconditional lsof/ps shell-out on every poll cycle for every user.

discoverLsofEndpoints (invoked every runFetchAllCycle) spawns lsof and, for each matched PID, ps — regardless of whether the user has Antigravity/Agy installed at all. A cheap existsSync(AGY_LOG_DIR) (or similar) short-circuit before shelling out would avoid the recurring child-process overhead for the majority of users who never use Antigravity.

Also applies to: 205-216

src/renderer/src/components/status-bar/usage-provider-settings-target.ts (1)

11-12: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider documenting why antigravity has no Accounts section.

Unlike the kimi case just below (which explains why it returns null), this new antigravity case has no rationale. A short comment (e.g., "Agy quota is host-local process discovery, not an account Orca manages") would prevent this from reading as an oversight.

✏️ Proposed comment addition
     case 'antigravity':
+      // Why: Agy quota comes from host-local LanguageServer discovery, not an
+      // account Orca manages, so there's no Accounts section to link to.
       return null

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f5b3a7c3-527d-413a-95db-e70b3d5d1544

📥 Commits

Reviewing files that changed from the base of the PR and between 5f64284 and 890b0ddba56e450c30054ce3dcff3ac388296f92.

📒 Files selected for processing (55)
  • mobile/src/components/accounts-snapshot.ts
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/main/codex-accounts/service.test.ts
  • src/main/index.ts
  • src/main/persistence.test.ts
  • src/main/persistence.ts
  • src/main/rate-limits/antigravity-usage-fetcher.test.ts
  • src/main/rate-limits/antigravity-usage-fetcher.ts
  • src/main/rate-limits/gemini-bucket-formatting.test.ts
  • src/main/rate-limits/gemini-bucket-formatting.ts
  • src/main/rate-limits/gemini-cli-oauth-extractor.ts
  • src/main/rate-limits/gemini-oauth-sources.ts
  • src/main/rate-limits/gemini-usage-fetcher.fallback.test.ts
  • src/main/rate-limits/gemini-usage-fetcher.test-fixtures.ts
  • src/main/rate-limits/gemini-usage-fetcher.test.ts
  • src/main/rate-limits/gemini-usage-fetcher.ts
  • src/main/rate-limits/service.test.ts
  • src/main/rate-limits/service.ts
  • src/main/runtime/rpc/methods/client-ui-schemas.ts
  • src/renderer/src/components/settings/AccountsPane.test.tsx
  • src/renderer/src/components/settings/AccountsPane.tsx
  • src/renderer/src/components/settings/AppearanceWindowSidebarSection.tsx
  • src/renderer/src/components/settings/accounts-search.ts
  • src/renderer/src/components/settings/appearance-status-bar-search.ts
  • src/renderer/src/components/stats/GrokUsagePane.test.tsx
  • src/renderer/src/components/status-bar/StatusBar.tsx
  • src/renderer/src/components/status-bar/StatusBarUsageEmptyCta.tsx
  • src/renderer/src/components/status-bar/UsageRosterPanel.tsx
  • src/renderer/src/components/status-bar/provider-segment-monthly-window.test.tsx
  • src/renderer/src/components/status-bar/status-bar-agent-gating.test.ts
  • src/renderer/src/components/status-bar/status-bar-agent-gating.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.test.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.ts
  • src/renderer/src/components/status-bar/tooltip.test.ts
  • src/renderer/src/components/status-bar/tooltip.tsx
  • src/renderer/src/components/status-bar/usage-error-copy.test.ts
  • src/renderer/src/components/status-bar/usage-error-copy.ts
  • src/renderer/src/components/status-bar/usage-provider-settings-target.test.ts
  • src/renderer/src/components/status-bar/usage-provider-settings-target.ts
  • src/renderer/src/hooks/useSettingsNavigationMetadata.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/store/slices/rate-limits.ts
  • src/renderer/src/store/slices/ui.test.ts
  • src/renderer/src/store/slices/ui.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/constants.ts
  • src/shared/rate-limit-types.test.ts
  • src/shared/rate-limit-types.ts
  • src/shared/status-bar-defaults.ts
  • src/shared/telemetry-events.ts
  • src/shared/types.ts
💤 Files with no reviewable changes (27)
  • src/main/rate-limits/gemini-bucket-formatting.test.ts
  • src/main/rate-limits/gemini-usage-fetcher.ts
  • src/main/rate-limits/gemini-cli-oauth-extractor.ts
  • src/renderer/src/components/settings/AppearanceWindowSidebarSection.tsx
  • src/shared/rate-limit-types.test.ts
  • src/renderer/src/components/settings/AccountsPane.test.tsx
  • src/main/rate-limits/gemini-bucket-formatting.ts
  • src/renderer/src/components/stats/GrokUsagePane.test.tsx
  • src/renderer/src/components/status-bar/usage-error-copy.ts
  • src/shared/status-bar-defaults.ts
  • src/main/rate-limits/gemini-usage-fetcher.fallback.test.ts
  • src/renderer/src/store/slices/rate-limits.ts
  • src/main/rate-limits/gemini-usage-fetcher.test-fixtures.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/main/runtime/rpc/methods/client-ui-schemas.ts
  • src/main/rate-limits/gemini-oauth-sources.ts
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/renderer/src/components/settings/accounts-search.ts
  • src/shared/telemetry-events.ts
  • src/main/rate-limits/gemini-usage-fetcher.test.ts
  • src/renderer/src/components/status-bar/usage-error-copy.test.ts
  • src/main/index.ts
  • src/main/codex-accounts/service.test.ts
  • src/renderer/src/components/status-bar/status-bar-agent-gating.test.ts
  • src/renderer/src/components/settings/appearance-status-bar-search.ts
  • src/shared/constants.ts
  • src/shared/types.ts

Parallelize process inspection, document the host-local settings boundary, and remove unreachable Gemini usage translations raised during review.

Constraint: Preserve lsof discovery when Agy is running without a usable log directory.

Rejected: Skip lsof when the Agy log directory is absent | that would remove the runtime discovery fallback.

Confidence: high

Scope-risk: narrow

Directive: Keep Antigravity discovery independent of Orca-managed account settings.

Tested: targeted Vitest, typecheck, oxfmt, oxlint, and localization catalog/extraction/coverage checks.

Not-tested: full repository test suite was not rerun for this review-only follow-up.

@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: 574db7d5-9414-4669-82a7-50a3a77ba8a2

📥 Commits

Reviewing files that changed from the base of the PR and between 890b0ddba56e450c30054ce3dcff3ac388296f92 and 838f3ed822973cfdc29a80b959041f851658341a.

📒 Files selected for processing (7)
  • src/main/rate-limits/antigravity-usage-fetcher.ts
  • src/renderer/src/components/status-bar/usage-provider-settings-target.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
💤 Files with no reviewable changes (5)
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/components/status-bar/usage-provider-settings-target.ts

Comment thread src/main/rate-limits/antigravity-usage-fetcher.ts Outdated
Comment thread src/main/rate-limits/antigravity-usage-fetcher.ts
Keep per-process inspection failures isolated and prefer authenticated duplicates so transient process exits or log-first discovery cannot hide a usable Agy endpoint.

Constraint: Endpoint discovery must tolerate races between lsof and ps while retaining CSRF authentication.

Rejected: Reverse discovery order only | it would encode preference indirectly and leave duplicate selection fragile.

Confidence: high

Scope-risk: narrow

Directive: Select duplicate Agy endpoints by authentication quality, not discovery order.

Tested: targeted Vitest, typecheck, oxfmt, oxlint, and max-lines ratchet.

Not-tested: full repository test suite was not rerun for this focused review fix.
@isairz

isairz commented Jul 31, 2026

Copy link
Copy Markdown
Author

Related: #11457

This PR takes a broader replacement approach: it removes the deprecated Gemini CLI OAuth usage backend rather than retaining it as a fallback, and treats Antigravity as a first-class provider. It also covers persisted-state migration, status-bar visibility, and Used/Remaining rendering.

Happy to align with the maintainers’ preferred direction if these should be consolidated.

Resolve the main-branch test overlap while preserving both the newer inactive Codex probe coverage and the Antigravity bucket regression test.

Constraint: Resolve PR stablyai#11536 conflicts without dropping upstream coverage

Rejected: Rebase and force-push | an ordinary merge preserves the published branch history

Confidence: high

Scope-risk: moderate

Directive: Keep Antigravity as the first-class quota provider when future Gemini usage changes land

Tested: 15 affected test files, 990 tests; pnpm typecheck; targeted oxlint and oxfmt

Not-tested: Full repository test suite
Resolve the latest upstream overlaps while retaining protected-secret cleanup, Kimi runtime-aware fetching, and localization improvements without restoring deprecated Gemini usage paths.

Constraint: Resolve PR stablyai#11536 conflicts while preserving current main behavior outside Gemini usage removal

Rejected: Rebase and force-push | an ordinary merge preserves the published review history

Confidence: high

Scope-risk: moderate

Directive: Do not reintroduce Gemini CLI OAuth usage when updating Antigravity quota code

Tested: Node 24.18.1; 15 affected test files, 978 tests; pnpm typecheck; targeted oxlint and oxfmt

Not-tested: Full repository test suite
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

Resolve the latest Accounts overlap by retaining upstream settings changes while excluding the deprecated Gemini CLI OAuth section and its unused UI import.

Constraint: Update PR stablyai#11536 to current main without changing its direct Agy quota contract

Rejected: Restore the Gemini settings section | it contradicts the migration and revives the deprecated usage path

Confidence: high

Scope-risk: narrow

Directive: Keep Gemini agent support separate from deprecated Gemini usage-provider settings

Tested: Node 24.18.1; 15 affected test files, 978 tests; pnpm typecheck; targeted oxlint and oxfmt

Not-tested: Full repository test suite
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@isairz

isairz commented Aug 11, 2026

Copy link
Copy Markdown
Author

Hi @brennanb2025, when you have a chance, could you please take a look at this PR? I’ve updated it against current main and resolved all conflicts. Thanks!

@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: c60805db-25c8-40b2-af6e-6dae2354f46f

📥 Commits

Reviewing files that changed from the base of the PR and between 550eabe and bf650626433ff5bab87ff733ec2004daf4585361.

📒 Files selected for processing (56)
  • mobile/src/components/accounts-snapshot.ts
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/main/codex-accounts/service.test.ts
  • src/main/index.ts
  • src/main/persistence.test.ts
  • src/main/persistence.ts
  • src/main/rate-limits/antigravity-endpoint-selection.ts
  • src/main/rate-limits/antigravity-usage-fetcher.test.ts
  • src/main/rate-limits/antigravity-usage-fetcher.ts
  • src/main/rate-limits/gemini-bucket-formatting.test.ts
  • src/main/rate-limits/gemini-bucket-formatting.ts
  • src/main/rate-limits/gemini-cli-oauth-extractor.ts
  • src/main/rate-limits/gemini-oauth-sources.ts
  • src/main/rate-limits/gemini-usage-fetcher.fallback.test.ts
  • src/main/rate-limits/gemini-usage-fetcher.test-fixtures.ts
  • src/main/rate-limits/gemini-usage-fetcher.test.ts
  • src/main/rate-limits/gemini-usage-fetcher.ts
  • src/main/rate-limits/service.test.ts
  • src/main/rate-limits/service.ts
  • src/main/runtime/rpc/methods/client-ui-schemas.ts
  • src/renderer/src/components/settings/AccountsPane.test.tsx
  • src/renderer/src/components/settings/AccountsPane.tsx
  • src/renderer/src/components/settings/AppearanceWindowSidebarSection.tsx
  • src/renderer/src/components/settings/accounts-search.ts
  • src/renderer/src/components/settings/appearance-status-bar-search.ts
  • src/renderer/src/components/stats/GrokUsagePane.test.tsx
  • src/renderer/src/components/status-bar/StatusBar.tsx
  • src/renderer/src/components/status-bar/StatusBarUsageEmptyCta.tsx
  • src/renderer/src/components/status-bar/UsageRosterPanel.tsx
  • src/renderer/src/components/status-bar/provider-segment-monthly-window.test.tsx
  • src/renderer/src/components/status-bar/status-bar-agent-gating.test.ts
  • src/renderer/src/components/status-bar/status-bar-agent-gating.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.test.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.ts
  • src/renderer/src/components/status-bar/tooltip.test.ts
  • src/renderer/src/components/status-bar/tooltip.tsx
  • src/renderer/src/components/status-bar/usage-error-copy.test.ts
  • src/renderer/src/components/status-bar/usage-error-copy.ts
  • src/renderer/src/components/status-bar/usage-provider-settings-target.test.ts
  • src/renderer/src/components/status-bar/usage-provider-settings-target.ts
  • src/renderer/src/hooks/useSettingsNavigationMetadata.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/store/slices/rate-limits.ts
  • src/renderer/src/store/slices/ui.test.ts
  • src/renderer/src/store/slices/ui.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/constants.ts
  • src/shared/rate-limit-types.test.ts
  • src/shared/rate-limit-types.ts
  • src/shared/status-bar-defaults.ts
  • src/shared/telemetry-events.ts
  • src/shared/types.ts
💤 Files with no reviewable changes (27)
  • src/renderer/src/components/settings/AccountsPane.test.tsx
  • src/shared/status-bar-defaults.ts
  • src/renderer/src/components/status-bar/usage-error-copy.test.ts
  • src/renderer/src/components/settings/appearance-status-bar-search.ts
  • src/main/rate-limits/gemini-usage-fetcher.fallback.test.ts
  • src/main/index.ts
  • src/main/rate-limits/gemini-oauth-sources.ts
  • src/renderer/src/components/settings/AppearanceWindowSidebarSection.tsx
  • src/renderer/src/components/settings/accounts-search.ts
  • src/shared/rate-limit-types.test.ts
  • src/main/rate-limits/gemini-usage-fetcher.test.ts
  • src/main/rate-limits/gemini-usage-fetcher.test-fixtures.ts
  • src/shared/constants.ts
  • src/main/runtime/rpc/methods/client-ui-schemas.ts
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/main/rate-limits/gemini-usage-fetcher.ts
  • src/shared/telemetry-events.ts
  • src/main/rate-limits/gemini-bucket-formatting.test.ts
  • src/renderer/src/components/status-bar/usage-error-copy.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/types.ts
  • src/main/codex-accounts/service.test.ts
  • src/renderer/src/store/slices/rate-limits.ts
  • src/renderer/src/components/stats/GrokUsagePane.test.tsx
  • src/renderer/src/components/status-bar/status-bar-agent-gating.test.ts
  • src/main/rate-limits/gemini-cli-oauth-extractor.ts
  • src/main/rate-limits/gemini-bucket-formatting.ts
🚧 Files skipped from review as they are similar to previous changes (28)
  • src/renderer/src/components/status-bar/UsageRosterPanel.tsx
  • src/renderer/src/components/status-bar/StatusBarUsageEmptyCta.tsx
  • src/renderer/src/components/status-bar/status-bar-agent-gating.ts
  • src/main/persistence.test.ts
  • src/renderer/src/store/slices/ui.ts
  • src/renderer/src/components/status-bar/provider-segment-monthly-window.test.tsx
  • src/main/rate-limits/antigravity-endpoint-selection.ts
  • src/renderer/src/components/status-bar/tooltip.tsx
  • src/renderer/src/components/status-bar/usage-provider-settings-target.test.ts
  • mobile/src/components/accounts-snapshot.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/components/status-bar/usage-provider-settings-target.ts
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/hooks/useSettingsNavigationMetadata.ts
  • src/renderer/src/store/slices/ui.test.ts
  • src/renderer/src/components/status-bar/StatusBar.tsx
  • src/main/persistence.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.ts
  • src/main/rate-limits/antigravity-usage-fetcher.test.ts
  • src/renderer/src/components/settings/AccountsPane.tsx
  • src/renderer/src/components/status-bar/tooltip.test.ts
  • src/renderer/src/i18n/locales/ko.json
  • src/main/rate-limits/service.ts
  • src/shared/rate-limit-types.ts
  • src/main/rate-limits/service.test.ts
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.test.ts
  • src/renderer/src/i18n/locales/ja.json

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

Copy link
Copy Markdown

Thanks for pushing the local Agy LanguageServer direction forward. I opened #14571 as a related implementation and linked this PR in its comparison section.

The two implementations share the same core authority—the already-running host-local Antigravity service—but differ in scope:

Cross-linking them so maintainers can compare the tradeoffs in one place. Thanks for the work and live validation here.

isairz added 4 commits August 15, 2026 18:47
Merge the latest mainline test and settings refactors while retaining Antigravity as the local quota authority and exposing both Gemini and Claude/GPT quota families.

Constraint: Agy exposes two independent model pools with separate five-hour and weekly limits.

Rejected: Retain the deprecated Gemini CLI usage fallback | it reports the wrong product quota and requires unrelated OAuth state.

Confidence: high

Scope-risk: moderate

Directive: Preserve all four Agy quota identities and do not reintroduce Gemini usage tracking when maintaining Gemini agent support.

Tested: Node 24 typecheck; 15 affected Vitest files with 233 tests; oxlint; type-aware src audit; reliability gates; max-lines ratchet; diff check.

Not-tested: Full repository lint is blocked by an upstream type-aware warning in config/scripts/pr-test-loc-summary.test.mjs; full test suite and Electron manual UI were not rerun after this merge.
Treat each selected log as an independent discovery attempt so one removed file cannot erase valid endpoints found on Windows or other log-only hosts.

Constraint: Agy rotates log files between directory listing and prefix reads.

Rejected: Catch the whole discovery loop | it discards already recoverable endpoints after one transient ENOENT.

Confidence: high

Scope-risk: narrow

Directive: Keep endpoint discovery failures isolated per candidate.

Tested: Antigravity fetcher 11 tests; Node 24 typecheck; targeted oxlint; diff check.

Not-tested: Full repository lint remains blocked by the unrelated origin/main warning documented in the PR body.
Preserve current main's Codex skip-state gating and split persistence layout while keeping Antigravity quota discovery independent of deprecated Gemini usage.

Constraint: Current main split persistence modules and changed provider refresh orchestration
Rejected: Restore the deprecated Gemini usage provider | Agy supplies its own four quota buckets
Confidence: high
Scope-risk: moderate
Directive: Keep Antigravity fetch independent when provider refresh orchestration changes
Tested: 15 focused Vitest files (247 tests); pnpm lint; changed-code quality; reliability gates; max-lines ratchet
Not-tested: Full repository test suite and build; typecheck is blocked by two unchanged current-main tab-search fixture errors
Update search fixtures for the current palette document contract and stop localization regression tests from requiring removed Gemini usage strings.

Constraint: Full validation must run after merging current main
Rejected: Mark baseline failures as passed | The fixtures can be corrected without changing product behavior
Confidence: high
Scope-risk: narrow
Directive: Keep retired-provider localization tests aligned with catalog removal
Tested: pnpm test (5,911 files; 55,565 tests); pnpm lint; pnpm typecheck; pnpm build; changed-code quality
Not-tested: None
@isairz

isairz commented Aug 18, 2026 •

Copy link
Copy Markdown
Author

Full validation is now complete after syncing dependencies to the refreshed lockfile:

  • pnpm test: 5,911 files / 55,565 tests passed (33 files / 183 tests skipped)
  • pnpm lint: passed
  • pnpm typecheck: passed
  • pnpm build: passed
  • changed-code quality: zero findings

Accept current main's authoritative tab-search fixtures while preserving the Agy quota migration and deprecated Gemini usage cleanup.\n\nTested: 25 affected files / 302 tests; typecheck; lint; build; changed-code quality; full suite 6,018 files / 56,658 tests passed with three unrelated parallel-interference failures passing isolated (2 files / 32 tests).
@isairz

isairz commented Aug 20, 2026

Copy link
Copy Markdown
Author

Updated to current main (d7a23c84a) and resolved the two conflicts in 39dd1456e. Both conflicts were in temporary tab-search test fixtures; current main now contains the authoritative versions, which this branch accepted unchanged. The Agy quota migration remains intact.

Fresh validation:

  • 25 affected test files / 302 tests passed
  • pnpm typecheck, pnpm lint, and pnpm build passed
  • changed-code quality: zero findings
  • full suite: 6,018 files / 56,658 tests passed; three unrelated parallel-interference failures passed in isolated reruns (2 files / 32 tests)
  • branch is 0 commits behind current main

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

@isairz I will review the updated pull request.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@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.

🧹 Nitpick comments (1)
src/renderer/src/components/status-bar/UsageRosterPanel.tsx (1)

38-45: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Update the comment to state the Antigravity exception.

The comment says: "Named model buckets keep their model name; fixed provider windows use their duration." This comment does not mention that Antigravity named buckets bypass their model name when useRemainingDuration is true. A future reader can miss this exception and break the getTightestUsageSection behavior during a refactor.

State the exception directly, for example: "Named model buckets keep their model name, except Antigravity buckets in remaining-duration mode, which show their reset duration instead."

Based on coding guidelines, comments must be concise, non-obvious, and brief. As per coding guidelines: "Comments must be concise, non-obvious, and brief—prefer one line; do not explain obvious behavior or walk through code."

✏️ Proposed comment update
-// Named model buckets keep their model name; fixed provider windows use their duration.
+// Named model buckets keep their model name, except Antigravity buckets in
+// remaining-duration mode, which show their reset duration instead of the bucket name.
 function shortLabel(

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 12eca255-a9ca-4aed-8379-f8f164f06720

📥 Commits

Reviewing files that changed from the base of the PR and between d7a23c8 and 39dd1456e7231bb600e2ab4d96b9cdc16c324e97.

📒 Files selected for processing (73)
  • config/scripts/wsl-git-shell-benchmark.mjs
  • mobile/src/components/accounts-snapshot.ts
  • src/main/codex-accounts/runtime-home-settings-test-fixtures.ts
  • src/main/codex-accounts/service-reset-credit-test-fixtures.ts
  • src/main/codex-accounts/service-test-harness.ts
  • src/main/index.ts
  • src/main/persistence-initial-load.test.ts
  • src/main/persistence/applying-settings/terminal-settings-migrations.ts
  • src/main/persistence/loading-store/store.ts
  • src/main/rate-limits/antigravity-endpoint-selection.ts
  • src/main/rate-limits/antigravity-quota-parser.ts
  • src/main/rate-limits/antigravity-usage-fetcher.test.ts
  • src/main/rate-limits/antigravity-usage-fetcher.ts
  • src/main/rate-limits/gemini-bucket-formatting.test.ts
  • src/main/rate-limits/gemini-bucket-formatting.ts
  • src/main/rate-limits/gemini-cli-oauth-extractor.ts
  • src/main/rate-limits/gemini-oauth-sources.ts
  • src/main/rate-limits/gemini-usage-fetcher.fallback.test.ts
  • src/main/rate-limits/gemini-usage-fetcher.test-fixtures.ts
  • src/main/rate-limits/gemini-usage-fetcher.test.ts
  • src/main/rate-limits/gemini-usage-fetcher.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-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/main/runtime/rpc/methods/client-ui-schemas.ts
  • src/renderer/src/components/WorktreeJumpPalette.test.tsx
  • src/renderer/src/components/settings/AccountsPane.test.tsx
  • src/renderer/src/components/settings/AccountsPane.tsx
  • src/renderer/src/components/settings/AppearanceWindowSidebarSection.tsx
  • src/renderer/src/components/settings/CliSkillRuntimeSetup.test.tsx
  • src/renderer/src/components/settings/CliSkillRuntimeSetup.tsx
  • src/renderer/src/components/settings/accounts-search.ts
  • src/renderer/src/components/settings/appearance-status-bar-search.ts
  • src/renderer/src/components/stats/GrokUsagePane.test.tsx
  • src/renderer/src/components/status-bar/StatusBar.tsx
  • src/renderer/src/components/status-bar/StatusBarUsageEmptyCta.tsx
  • src/renderer/src/components/status-bar/UsageRosterPanel.test.tsx
  • src/renderer/src/components/status-bar/UsageRosterPanel.tsx
  • src/renderer/src/components/status-bar/provider-segment-monthly-window.test.tsx
  • src/renderer/src/components/status-bar/status-bar-agent-gating.test.ts
  • src/renderer/src/components/status-bar/status-bar-agent-gating.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.test.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.ts
  • src/renderer/src/components/status-bar/tooltip.test.ts
  • src/renderer/src/components/status-bar/tooltip.tsx
  • src/renderer/src/components/status-bar/usage-error-copy.test.ts
  • src/renderer/src/components/status-bar/usage-error-copy.ts
  • src/renderer/src/components/status-bar/usage-provider-settings-target.test.ts
  • src/renderer/src/components/status-bar/usage-provider-settings-target.ts
  • src/renderer/src/hooks/useIpcEvents-rate-limit-hydration.test.ts
  • src/renderer/src/hooks/useSettingsNavigationMetadata.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/i18n/zh-technical-literal-mistranslations.test.ts
  • src/renderer/src/store/slices/rate-limits.ts
  • src/renderer/src/store/slices/ui-hydration-workspace-preferences.test.ts
  • src/renderer/src/store/slices/ui.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/constants.ts
  • src/shared/global-settings-types.ts
  • src/shared/rate-limit-types.test.ts
  • src/shared/rate-limit-types.ts
  • src/shared/status-bar-defaults.ts
  • src/shared/telemetry-events.ts
  • src/shared/ui-chrome-types.ts
💤 Files with no reviewable changes (31)
  • src/shared/global-settings-types.ts
  • src/shared/status-bar-defaults.ts
  • src/shared/constants.ts
  • src/shared/telemetry-events.ts
  • src/shared/ui-chrome-types.ts
  • src/renderer/src/components/settings/appearance-status-bar-search.ts
  • src/main/codex-accounts/service-reset-credit-test-fixtures.ts
  • src/renderer/src/store/slices/rate-limits.ts
  • src/renderer/src/hooks/useIpcEvents-rate-limit-hydration.test.ts
  • src/main/rate-limits/gemini-usage-fetcher.fallback.test.ts
  • src/main/rate-limits/gemini-usage-fetcher.test-fixtures.ts
  • src/main/rate-limits/gemini-usage-fetcher.test.ts
  • src/shared/rate-limit-types.test.ts
  • src/renderer/src/components/settings/AppearanceWindowSidebarSection.tsx
  • src/renderer/src/components/settings/accounts-search.ts
  • src/main/runtime/rpc/methods/client-ui-schemas.ts
  • src/main/rate-limits/gemini-bucket-formatting.test.ts
  • src/main/rate-limits/gemini-usage-fetcher.ts
  • src/renderer/src/components/stats/GrokUsagePane.test.tsx
  • src/main/codex-accounts/runtime-home-settings-test-fixtures.ts
  • src/main/rate-limits/gemini-oauth-sources.ts
  • src/main/codex-accounts/service-test-harness.ts
  • src/main/index.ts
  • src/main/rate-limits/gemini-bucket-formatting.ts
  • src/main/rate-limits/gemini-cli-oauth-extractor.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/renderer/src/components/status-bar/usage-error-copy.ts
  • src/renderer/src/components/status-bar/usage-error-copy.test.ts
  • src/renderer/src/components/settings/AccountsPane.test.tsx
  • src/renderer/src/i18n/zh-technical-literal-mistranslations.test.ts
  • src/renderer/src/components/status-bar/status-bar-agent-gating.test.ts
🚧 Files skipped from review as they are similar to previous changes (19)
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/hooks/useSettingsNavigationMetadata.ts
  • src/renderer/src/components/status-bar/status-bar-agent-gating.ts
  • mobile/src/components/accounts-snapshot.ts
  • src/renderer/src/components/status-bar/StatusBarUsageEmptyCta.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/renderer/src/i18n/locales/es.json
  • src/renderer/src/components/status-bar/tooltip.tsx
  • src/main/rate-limits/antigravity-endpoint-selection.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.ts
  • src/main/rate-limits/antigravity-usage-fetcher.test.ts
  • src/renderer/src/components/settings/AccountsPane.tsx
  • src/shared/rate-limit-types.ts
  • src/main/rate-limits/service.ts
  • src/renderer/src/store/slices/ui.ts
  • src/renderer/src/components/status-bar/StatusBar.tsx
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.test.ts

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

@isairz

isairz commented Aug 23, 2026

Copy link
Copy Markdown
Author

Updated to current main (3d74f5fe03) and resolved the Agy/Gemini usage conflicts. The refresh keeps direct host-local Agy LanguageServer quota reads, removes the interim Gemini-to-Antigravity mirror now present on main, and migrates process discovery to Orca’s shared runProcess boundary.

Validation on head 80579dae58:

  • affected tests: 23 files / 304 tests passed
  • full suite exercised: 6,124 files / 57,613 tests passed; the environment-only failure passed with ORCA_ORIG_ZDOTDIR cleared, and the child-process boundary assertions passed after the fix
  • pnpm typecheck, pnpm lint, and pnpm build passed
  • changed-code quality: 0 findings

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

@isairz I will review the updated pull request and the Agy LanguageServer quota changes.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@isairz

isairz commented Aug 24, 2026

Copy link
Copy Markdown
Author

Hi @brennanb2025 @nwparker — could one of you please take a look when you have a chance? This PR has been kept current with main, is conflict-free, and the latest validation is complete. It cleanly migrates the deprecated Gemini CLI usage path to direct host-local Agy quota reads while preserving all four quota buckets and persisted-state migration.

If the maintainers prefer a different direction, a quick direction call would also be very helpful. Thanks!

@jeffhuen

jeffhuen commented Sep 5, 2026

Copy link
Copy Markdown

Independent verification of the mechanism on macOS arm64 (no Gemini CLI installed, no ~/.gemini/oauth_creds.json — exactly the broken setup from #9122):

  • POST {} http://127.0.0.1:<agy-port>/exa.language_server_pb.LanguageServerService/RetrieveUserQuotaSummary against live agy listeners returns real quota groups (Gemini Models weekly + 5h with remaining fractions and reset times). The odd ports answer HTTPS (mirroring the PR's try-next-endpoint loop); the HTTP ones answer.
  • On this branch: all 428 tests under src/main/rate-limits/ pass (41 files).
  • One unrelated note: node typecheck shows a single pre-existing error in src/main/browser/cdp-print-to-pdf.ts (marginType), untouched by this diff — looks like dep drift, not this PR.

@nwparker

Copy link
Copy Markdown
Contributor

Review verdict: Do not merge as-is; superseded by #21654 → #21678. This broad migration carries the older Gemini/OAuth and quota-mirror assumptions that the maintained Antigravity CLI stack deliberately removes or gates. The current stack has newer tests, configured executable handling, and live /usage evidence.

@leonardoasb

Copy link
Copy Markdown

Tester offer, plus one fresh datapoint that makes this path load-bearing rather than a nice-to-have.

On Orca 1.4.217 (macOS arm64) I measured the current Gemini-CLI mirror end to end:

  • ~/.gemini/oauth_creds.json expired since 2026-09-23, refresh token still valid;
  • with no @google/gemini-cli installed the refresh is never attempted → Token refresh failed;
  • after installing @google/gemini-cli 0.62.0 (so the eta() bundle path resolves the client credentials) the same refresh Orca performs returns 200 with an access token;
  • with that token, loadCodeAssist returns 200 with allowedTiers: ["standard-tier"], currentTier: null, and no cloudaicompanionProject → M4() throws Gemini project ID not found; retrieveUserQuota with a project id passed manually returns 403;
  • and re-authenticating Gemini CLI to create that project is now refused by Google: "This client is no longer supported for Gemini Code Assist for individuals. To continue using Gemini, please migrate to the Antigravity suite of products".

So the mirror cannot be rescued by fixing the credential lookup alone — reading the Agy quota directly (this PR) is the only path that can work for Antigravity users.

Happy to validate a build of this PR on macOS (Apple Silicon) against a real signed-in agy (1.2.10, agy models works, real quota visible via the CLI) and report back the four buckets, the 5h/weekly windows, and what happens when agy is signed out — say the word if that is useful before merge.

@nwparker

Copy link
Copy Markdown
Contributor

Thanks for the work on this, and for your patience. Orca now reads Antigravity quota from the agy CLI (#24073), has native Antigravity Accounts (#24691), and short pool labels in the status bar (#31007), which covers what this PR set out to do. Closing as superseded; your effort here helped shape the problem, so thank you.

@nwparker nwparker closed this Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

7 participants