Skip to content

feat(rate-limits & i18n): support Antigravity live quota, provider branding, and complete UI localization - #18167

Closed
eojonathan wants to merge 16 commits into
stablyai:mainfrom
eojonathan:fix/antigravity-quota-credentials
Closed

eojonathan wants to merge 16 commits into
stablyai:mainfrom
eojonathan:fix/antigravity-quota-credentials

Conversation

@eojonathan

@eojonathan eojonathan commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Adds live Google Antigravity quota tracking via local Connect-RPC, updates provider settings and branding to Antigravity, and adds complete UI localization for orchestration prompts and status bar.


📸 Visual Proofs / Demonstration

Here are screenshots from the running desktop application showcasing the implementation in action:

1. Live Quota in Status Bar (Dual-bar Monitor & Provider Menu)

Real-time session (5h) and weekly quota tracking queried via local Language Server RPC, with the official Google Antigravity branding and icon:

Status Bar Dual Bars Live Quota Detail Popup
Status Bar Bars Quota Detail Popup

2. Settings & Account Management

Dedicated Google Antigravity account toggle with official AntigravityIcon and status bar toggle:

Accounts Settings Status Bar Indicators
Accounts Settings Status Bar Settings

English Version

Key Changes

  • Live Antigravity Quota Monitoring: Connects to the local Language Server via Connect-RPC (GetUserStatus) to track 5h and weekly quota usage every 60 seconds with a clean 2-bar presentation.
  • Provider Account Settings & Branding: Replaced "Gemini" with "Antigravity" in settings with the official AntigravityIcon and removed the (experimental) label.
  • UI Internationalization: Localized orchestration prompt examples (translate()), status bar reset countdowns, and relative update timestamps.

Testing & Verification

  • pnpm tc passes across all workspace packages without type errors.
  • Unit tests for rate-limit fetcher and i18n components pass (pnpm test).
  • Status bar dynamically reflects 5h and weekly quota usage every 60 seconds.
  • Settings search properly indexes and filters "antigravity".

Versão em Português

Principais Alterações

  • Monitoramento de Cotas do Antigravity: Conexão com o Language Server local via Connect-RPC para acompanhar cotas de 5h e semanal a cada 1 minuto em layout limpo de 2 barras.
  • Contas de Provedor & Marca: Substituição de "Gemini" por "Antigravity" nas configurações com AntigravityIcon oficial e remoção da etiqueta (experimental).
  • Internacionalização da Interface: Tradução dos prompts de orquestração, contagem regressiva e horários de atualização na barra de status.

Testes e Verificação

  • pnpm tc passa sem erros em todos os projetos.
  • Testes unitários do leitor de cotas e do i18n passando (pnpm test).
  • Barra de status reflete dinamicamente a cota de 5h e semanal em 1 minuto.
  • Busca de configurações indexa "antigravity" perfeitamente.

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

This PR introduces a CI-breaking test plus two regressions in the shared rate-limit polling/service layer that need to be resolved before merge.

Reviewed changes

  • Live Antigravity quota fetch — new endpoint discovery (antigravity-local-endpoint-discovery.ts) scanning ps/lsof/netstat + process tables for the Antigravity language server, and a Connect-RPC client (antigravity-local-usage-fetcher.ts) that reads 5h/weekly buckets and switches between Gemini and 3P (Claude/GPT) windows.
  • Credential resolution — gemini-cli-oauth-extractor.ts and gemini-oauth-sources.ts now discover Antigravity binaries/paths, accept env overrides, and read a broader set of credential/project files.
  • Gemini fetcher wiring — fetchGeminiRateLimits tries the local language server first, falling back to the existing OAuth paths.
  • Poll cadence & provider refresh — global DEFAULT_POLL_MS/MIN_REFETCH_MS tightened, and gemini/antigravity added to the individually-refreshable provider set.
  • Branding & i18n — Gemini→Antigravity in settings, AntigravityIcon, localized status-bar timestamps/countdown, and wrapped orchestration prompt examples.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

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.

  • Last reviewed commit: a002ec5d090a97d148243ea35b29260ce502a279
  • Latest commit, not reviewed: ceb2fa3

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
Walkthrough

The change adds local Antigravity endpoint discovery and RPC-based usage fetching. Gemini rate-limit fetching checks local Antigravity data before its existing authenticated flow. OAuth extraction supports Antigravity binaries, package layouts, credential files, environment variables, and project-ID caches. Renderer settings, icons, usage labels, orchestration prompts, and English localization now include Antigravity or localized strings.

Merge Risk: Moderate · previous review a002e

This adds live Antigravity quota tracking, but users running multiple language-server processes may see unavailable or stale quota data because local requests can use the wrong authentication token. Resolve the endpoint/token association before merging.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.13% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 31 functions across 18 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description explains the main changes, includes visual proof, and reports testing, but it omits required template sections, including ELI5, Why, a Linked Issue, AI Disclosure, Review, Agent skill … Add the missing template sections. Include a valid issue reference under Linked Issue, provide the requested rationale and review details, complete the cross-platform and compatibility notes, and confirm the checklist items or explain why t…
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the main changes: Antigravity live quota support, provider branding, and UI localization.
Full details: Description check

Explanation

The description explains the main changes, includes visual proof, and reports testing, but it omits required template sections, including ELI5, Why, a Linked Issue, AI Disclosure, Review, Agent skill upstream boundary, Notes, and the checklist.

Resolution

Add the missing template sections. Include a valid issue reference under Linked Issue, provide the requested rationale and review details, complete the cross-platform and compatibility notes, and confirm the checklist items or explain why they do not apply.

Finishing Touches
Resolve merge conflicts
  • Resolve merge conflict in branch fix/antigravity-quota-credentials
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@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: 6

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

30-32: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover the successful local-result branch.

This module-level mock always returns null, so tests in this file bypass the new early return. Add a test that returns an ok local result and verifies that OAuth fallback is not used. Keep a null or rejection case for fallback coverage.

src/renderer/src/lib/orchestration-usage-examples.ts (1)

17-18: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use an intent-named interpolation placeholder.

The new prompts use {{value0}} and { value0: ... }. Rename this consistently to a name such as {{orchestrationCommand}}, and update the matching catalog entries and options objects.

Based on learnings, new user-facing strings should use intent-named localization IDs with named interpolation placeholders.

Also applies to: 33-34, 46-47, 62-63, 78-79

Source: Learnings

src/renderer/src/components/settings/accounts-search.ts (1)

102-110: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Stale "experimental" search keyword.

This entry's title and description drop the "(experimental)" wording, matching the settings-panel rebrand. The keywords list on line 120 still keeps the experimental keyword ('auto.components.settings.accounts.search.b7c2cee442'), while the corresponding keywords array in accounts-pane-provider-setting-sections.tsx already removed it. Remove the same keyword here for consistency.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 74d2bc40-759a-49f3-a853-628a965025fa

📥 Commits

Reviewing files that changed from the base of the PR and between e5a1e79 and 3b2360033f18d344872d54518e1ee3a30cb310cb.

📒 Files selected for processing (18)
  • src/main/rate-limits/antigravity-local-endpoint-discovery.ts
  • src/main/rate-limits/antigravity-local-usage-fetcher.test.ts
  • src/main/rate-limits/antigravity-local-usage-fetcher.ts
  • src/main/rate-limits/antigravity-usage-mirror.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.ts
  • src/main/rate-limits/gemini-usage-fetcher.ts
  • src/main/rate-limits/service/service-types.ts
  • src/renderer/src/components/settings/accounts-pane-provider-setting-sections.tsx
  • src/renderer/src/components/settings/accounts-search.ts
  • src/renderer/src/components/status-bar/UsageRosterPanel.tsx
  • src/renderer/src/components/status-bar/icons.tsx
  • src/renderer/src/components/status-bar/tooltip.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/orchestration-usage-examples.ts
  • src/shared/global-settings-types.ts

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

const serverPort = Number.parseInt(serverPortStr, 10)
if (serverPort > 0 && serverPort <= 65535) {
endpoints.push({ port: serverPort, isHttps: true, csrfToken: csrf })
endpoints.push({ port: serverPort, isHttps: false, csrfToken: csrf })

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.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- relevant repository conventions ---'
find /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4 -maxdepth 2 -type f -name '*.md' -print
printf '%s\n' '--- endpoint discovery ---'
cat -n src/main/rate-limits/antigravity-local-endpoint-discovery.ts | sed -n '1,230p'
printf '%s\n' '--- usage fetcher contract and request sink ---'
ast-grep outline src/main/rate-limits/antigravity-local-usage-fetcher.ts
cat -n src/main/rate-limits/antigravity-local-usage-fetcher.ts | sed -n '1,155p'

Repository: stablyai/orca

Length of output: 17553


Sensitive Data Exposure (CWE-319): Cleartext Transmission of Sensitive Information

Reachability: Internal · Exploitability: Difficult

Do not attach the CSRF token to HTTP candidates.

requestRpcJson sends X-Codeium-Csrf-Token for both transports. Keep csrfToken only on HTTPS candidates to prevent cleartext transmission over the loopback connection.

port,
path,
method: 'POST',
rejectUnauthorized: false,

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.

🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- repository conventions ---'
find /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4 -path '*/conventions/*' -type f -print -exec sh -c 'echo "--- $1"; cat "$1"' sh {} \;
printf '%s\n' '--- target outline ---'
ast-grep outline src/main/rate-limits/antigravity-local-usage-fetcher.ts
printf '%s\n' '--- target implementation ---'
cat -n src/main/rate-limits/antigravity-local-usage-fetcher.ts | sed -n '1,150p'
printf '%s\n' '--- endpoint discovery contract ---'
cat -n src/main/rate-limits/antigravity-local-endpoint-discovery.ts | sed -n '1,240p'

Repository: stablyai/orca

Length of output: 18357


🏁 Script executed:

#!/bin/bash
set -eu
cat -n src/main/rate-limits/antigravity-local-usage-fetcher.ts | sed -n '141,245p'

Repository: stablyai/orca

Length of output: 3934


Security Misconfiguration (CWE-295): Improper Certificate Validation

Exploitability: Difficult

Authenticate the local usage endpoint.

rejectUnauthorized: false disables HTTPS peer authentication, and endpoint discovery also probes the same port over plain HTTP. A local process can therefore supply forged quota data, including on a request carrying X-Codeium-Csrf-Token. Use a trusted certificate or public-key pin, and remove the HTTP fallback.

@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: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 65cc7825-dc7b-46c9-a00b-9ca687845a99

📥 Commits

Reviewing files that changed from the base of the PR and between 3b2360033f18d344872d54518e1ee3a30cb310cb and fa9eb0318da8c693d1a8205b32ecb297841cadc3.

📒 Files selected for processing (8)
  • src/main/rate-limits/antigravity-local-usage-fetcher.test.ts
  • src/main/rate-limits/antigravity-local-usage-fetcher.ts
  • src/main/rate-limits/gemini-oauth-sources.ts
  • src/main/rate-limits/gemini-usage-fetcher.test.ts
  • src/main/rate-limits/service/service-types.ts
  • src/renderer/src/components/settings/accounts-search.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/orchestration-usage-examples.ts
💤 Files with no reviewable changes (1)
  • src/renderer/src/components/settings/accounts-search.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/main/rate-limits/antigravity-local-usage-fetcher.test.ts
  • src/renderer/src/lib/orchestration-usage-examples.ts
  • src/main/rate-limits/gemini-oauth-sources.ts
  • src/renderer/src/i18n/locales/en.json

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

Comment on lines +64 to +66
const timer = setTimeout(() => {
req.destroy()
settle({ ok: false, error: 'timeout' })

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.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- repository conventions and learnings ---'
find /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4 -maxdepth 2 -type f -name '*.md' -print
printf '%s\n' '--- target file ---'
cat -n src/main/rate-limits/antigravity-local-usage-fetcher.ts
printf '%s\n' '--- package/runtime declarations ---'
for f in package.json .nvmrc .node-version; do
  if [ -f "$f" ]; then
    echo "--- $f"
    cat -n "$f"
  fi
done

Repository: stablyai/orca

Length of output: 38916


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- rate-limit learnings ---'
cat /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/learnings/src-main-rate-limits.md
printf '%s\n' '--- scoped conventions ---'
cat /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/conventions/repo-wide.md
printf '%s\n' '--- rate-limit files and references ---'
git ls-files 'src/main/rate-limits' '*rate-limit*' | sed -n '1,160p'
rg -n --glob '*.{ts,tsx,js,mjs}' 'requestRpcJson|antigravity-local-usage-fetcher|X-Codeium-Csrf-Token|CONNECT_RPC_TIMEOUT_MS' src tests

Repository: stablyai/orca

Length of output: 11326


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- focused regression tests ---'
cat -n src/main/rate-limits/antigravity-local-usage-fetcher.test.ts
printf '%s\n' '--- Node runtime ---'
node --version
printf '%s\n' '--- Node http.request header-validation behavior ---'
node - <<'JS'
const http = require('node:http')
for (const value of ['ok', 'bad\nvalue', 'bad\r\nvalue']) {
  try {
    http.request({
      hostname: '127.0.0.1',
      port: 1,
      method: 'POST',
      headers: { 'X-Codeium-Csrf-Token': value }
    })
    console.log(JSON.stringify(value), 'did not throw synchronously')
  } catch (error) {
    console.log(JSON.stringify(value), 'threw synchronously:', error.code, error.message)
  }
}
JS

Repository: stablyai/orca

Length of output: 8584


Handle synchronous request-construction failures.

If http.request throws during header validation, the promise rejects before req is assigned. The timer remains active and later reads the uninitialized req binding, which can raise an uncaught ReferenceError. Catch the construction error, call settle, and clear the timer. Add a regression test under Node 24.

settle({ ok: false, error: 'response too large' })
return
}
data += chunk

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

printf '%s\n' '--- applicable repository conventions ---'
find /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4 -maxdepth 2 -type f -name '*.md' -print | sort
printf '%s\n' '--- target file outline ---'
ast-grep outline src/main/rate-limits/antigravity-local-usage-fetcher.ts
printf '%s\n' '--- target implementation ---'
sed -n '1,180p' src/main/rate-limits/antigravity-local-usage-fetcher.ts
printf '%s\n' '--- relevant IncomingMessage/encoding usage ---'
rg -n -C 3 'IncomingMessage|setEncoding|data \+= chunk|planType|antigravity-local-usage-fetcher' src/main

Repository: stablyai/orca

Length of output: 50369


🏁 Script executed:

printf '%s\n' '--- rate-limit conventions ---'
cat /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/conventions/repo-wide.md
cat /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/learnings/src-main-rate-limits.md
printf '%s\n' '--- focused tests around response handling ---'
sed -n '1,210p' src/main/rate-limits/antigravity-local-usage-fetcher.test.ts
printf '%s\n' '--- remaining target flow ---'
sed -n '100,290p' src/main/rate-limits/antigravity-local-usage-fetcher.ts

Repository: stablyai/orca

Length of output: 13866


Preserve UTF-8 across response chunks.

Without res.setEncoding('utf8'), IncomingMessage emits Buffer chunks. data += chunk decodes each chunk independently, so a split multibyte character can corrupt the JSON before JSON.parse(). Set the encoding before reading, or concatenate buffers and decode once.

@@ -68,8 +68,7 @@ export type ActiveWindowRefreshPlan =
| { kind: 'full' }
| { kind: 'providers'; providers: ActiveRateLimitProvider[] }

// Why: Claude's usage endpoint has a tight budget and quota is only informational; prefer a recent snapshot over polling into 429s.
export const DEFAULT_POLL_MS = 15 * 60 * 1000 // 15 minutes
export const DEFAULT_POLL_MS = 15 * 60 * 1000 // 15 minutes — safe cadence to avoid tight cloud 429 rate limits

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.

🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- repository knowledge scopes ---'
find /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4 -maxdepth 2 -type f -name '*.md' -print
printf '%s\n' '--- target file ---'
cat -n src/main/rate-limits/service/service-types.ts
printf '%s\n' '--- rate-limit service files ---'
find src/main/rate-limits -type f -maxdepth 5 -print
printf '%s\n' '--- related symbols and Antigravity references ---'
rg -n -S 'DEFAULT_POLL_MS|Antigravity|antigravity|poll|refresh|quota|60.?seconds|60.?000' src/main/rate-limits src/main --glob '!**/node_modules/**' | head -300

Repository: stablyai/orca

Length of output: 50369


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- applicable repository convention ---'
cat /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/conventions/repo-wide.md
printf '%s\n' '--- applicable rate-limit learning ---'
cat /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/learnings/src-main-rate-limits.md
printf '%s\n' '--- polling implementation ---'
cat -n src/main/rate-limits/service/service-polling.ts
printf '%s\n' '--- state and configuration ---'
cat -n src/main/rate-limits/service/service-state.ts
cat -n src/main/rate-limits/service/service-configuration.ts
printf '%s\n' '--- provider cycles and application ---'
cat -n src/main/rate-limits/service/service-provider-cycles.ts
cat -n src/main/rate-limits/service/service-full-cycle-application.ts
printf '%s\n' '--- Antigravity mirror ---'
cat -n src/main/rate-limits/antigravity-usage-mirror.ts

Repository: stablyai/orca

Length of output: 41063


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- fetchAll binding and timer setup ---'
cat -n src/main/rate-limits/service/service-fetch-queue.ts
cat -n src/main/rate-limits/service.ts
printf '%s\n' '--- polling interval callers ---'
rg -n -S 'setPollingInterval|pollInterval|start\(' src/main src --glob '*.ts' --glob '!**/*.test.ts' | head -160
printf '%s\n' '--- Gemini fetch preparation ---'
rg -n -S 'fetchGemini|geminiResult|runFetchAllCycle|fetchAll' src/main/rate-limits/service/service-full-cycle-preparation.ts src/main/rate-limits/service/service-fetch-control.ts src/main/rate-limits/service/service-fetch-queue.ts

Repository: stablyai/orca

Length of output: 27382


Add a provider-specific 60-second refresh path for Antigravity. RateLimitServicePolling uses DEFAULT_POLL_MS, and RateLimitServiceFullCycleApplication derives Antigravity from the Gemini result in that cycle. No separate path exists, so quota data can remain stale for up to 15 minutes. Do not lower the global default.

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

Important

One prior concern remains unresolved and blocks merge: the local Connect-RPC contract is unverified.

Reviewed changes (delta against the prior Pullfrog review)

  • Fixed the CI-breaking test — antigravity-local-usage-fetcher.test.ts now seeds the ps discovery branch via runProcessMock, so discoverAntigravityEndpoints returns an endpoint on Linux/macOS (verified: 13 tests pass locally).
  • Reverted the shared polling regressions — DEFAULT_POLL_MS (15m) and MIN_REFETCH_MS (5m) are back to their pre-PR values, and gemini/antigravity were dropped from INDIVIDUALLY_REFRESHABLE_PROVIDERS, restoring fetchAll()-based recovery for those providers.
  • Hardened the Connect-RPC client — requestRpcJson gained a 5MB response cap, a single-settlement guard, explicit response/request error handlers, and a timer-based timeout, plus a comment explaining rejectUnauthorized: false.
  • Fixed credential persistence — saveGeminiCredentials now writes to lastActiveCredsPath (previously it always renamed to OAUTH_CREDS_PATH) and merges refreshed tokens into the existing google/oauth/credentials shape instead of clobbering the file.
  • Completed the localization cleanup — orchestration placeholders renamed {{value0}} → {{orchestrationCommand}}, and the stale experimental search keyword was removed.

⚠️ Local Connect-RPC contract still unconfirmed

The new commit added the requested rejectUnauthorized comment, but the substantive question from the prior review stands: the CSRF header is X-Codeium-Csrf-Token (a Codeium/Windsurf vendor name) and the RPC paths are /exa.language_server_pb.LanguageServerService/..., neither of which matches the PR description's google.internal.antigravity.v1.AntigravityService/GetUserStatus. If either is wrong, the local server rejects every request and the headline "live quota" feature silently degrades to the OAuth fallback, which the author should rule out before this ships.

Technical details
# Verify the Antigravity language-server Connect-RPC contract

## Affected sites
- src/main/rate-limits/antigravity-local-usage-fetcher.ts:85 — `X-Codeium-Csrf-Token` header
- src/main/rate-limits/antigravity-local-usage-fetcher.ts:143 — `/exa.language_server_pb.LanguageServerService/RetrieveUserQuotaSummary`
- src/main/rate-limits/antigravity-local-usage-fetcher.ts:153 — `/exa.language_server_pb.LanguageServerService/GetUserStatus`

## Required outcome
- Confirm the CSRF header name and both service paths against the actual Antigravity language-server contract, and correct them or document why the Codeium-named identifiers are in fact correct.

## Open questions for the human
- Is `exa.language_server_pb` / `X-Codeium-Csrf-Token` genuinely the Antigravity LS wire protocol, or was it lifted from a Codeium/Windsurf client?

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@eojonathan

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review!

To clarify the wire protocol question regarding \�xa.language_server_pb\ and \X-Codeium-Csrf-Token:

The local Google Antigravity Language Server binary (\language_server_windows_x64.exe\ / \�gy) is built upon the Codeium/Exa Language Server architecture.

  • The binary accepts the --csrf_token \ process argument.
  • The HTTP header required by the local server on \127.0.0.1\ is indeed \X-Codeium-Csrf-Token.
  • The Connect-RPC service endpoints compiled in the binary are /exa.language_server_pb.LanguageServerService/RetrieveUserQuotaSummary\ and /exa.language_server_pb.LanguageServerService/GetUserStatus.

This has been validated with live Antigravity Language Server sessions, successfully retrieving real-time 5h/weekly quotas. We have also documented this in the codebase comments in commit \

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

✅ No new issues found.

Reviewed changes (delta against the prior pullfrog review)

  • Localized the sidebar section title — SidebarHeader now renders Projects/Workspaces via translate('auto.components.sidebar.SidebarHeader.projects', 'Projects') (and .workspaces) instead of hardcoded strings, with the two en.json keys added under SidebarHeader. Non-English locales fall back to the English defaults until their translators catch up, matching the repo's incremental-localization contract.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@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: Team

Run ID: fd7536a2-09c7-4cad-a93b-74c2fd14555b

📥 Commits

Reviewing files that changed from the base of the PR and between 08bff116f190c2b8d06f484058afd05a7a5a153a and c586b41f333f8c553fd497efde4b0e8a4b6fdd54.

📒 Files selected for processing (2)
  • src/renderer/src/components/sidebar/SidebarHeader.tsx
  • src/renderer/src/i18n/locales/en.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/i18n/locales/en.json

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

@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: Team

Run ID: 94c5f0e8-4d10-43cb-b612-32b7e3801ae7

📥 Commits

Reviewing files that changed from the base of the PR and between c586b41f333f8c553fd497efde4b0e8a4b6fdd54 and a002ec5d090a97d148243ea35b29260ce502a279.

📒 Files selected for processing (1)
  • src/main/rate-limits/antigravity-local-endpoint-discovery.ts

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

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

ℹ️ No critical issues — one minor suggestion inline.

Reviewed changes (delta against the prior Pullfrog review)

  • Prioritized HTTPS in Antigravity endpoint discovery — discoverAntigravityEndpoints now returns HTTPS candidates before HTTP fallbacks (previously the netstat/lsof branches surfaced isHttps: false first), avoiding the TLS handshake error produced when probing an HTTPS-only language server over HTTP. Discovered CSRF tokens are now also threaded onto the netstat/lsof-derived endpoints.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

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

✅ No new issues found.

Reviewed changes (delta against the prior Pullfrog review)

  • PID-scoped CSRF matching — parseNetstatListeningPorts/parseLsofListeningPorts now return {port, pid} objects, and discoverAntigravityEndpoints looks up csrfByPid.get(pid) per discovered port instead of applying a single latestCsrf to every endpoint. This resolves the prior csrfByPid-dead-code nit and removes the "last process scanned" heuristic, so a second concurrent agy/language_server process can no longer attach the wrong CSRF token to unrelated ports.
  • Reactive sidebar localization — the memoized SidebarHeader now subscribes to language changes via useTranslation(), so its Projects/Workspaces titles (rendered through the imperative translate) re-render on locale switch instead of going stale until an unrelated state update.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@eojonathan
eojonathan force-pushed the fix/antigravity-quota-credentials branch from 083912a to 8aa0a07 Compare September 3, 2026 05:22

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

✅ No new issues found.

Reviewed changes (delta against the prior Pullfrog review)

  • Rebased onto current main — the branch was force-pushed as a pure rebase: all 13 commit subjects are unchanged from the previously-reviewed head 083912a, only the SHAs changed. No PR-authored content changed. The rebase absorbed the "New agent dashboard" rewrite of SidebarHeader (its agentsViewActive/activityLabel/acknowledgeIntro code now surrounds the PR's translate()-based Projects/Workspaces title) and the base en.json key churn.

Verification (no conflict markers, en.json parses with no duplicate keys, projects/workspaces/Antigravity/orchestration/tooltip keys intact, PID-scoped CSRF csrfByPid.get(pid) with no latestCsrf remnant, HTTPS-first endpoint ordering preserved).

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@hongvincent hongvincent left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

test

@hongvincent

Copy link
Copy Markdown

Tested this locally on macOS arm64 (Orca 1.4.194, Antigravity 2.12.2 / agy 1.1.22).

Prior to this patch, the Antigravity status bar segment was stuck on "Antigravity usage is not available" because Google deprecated individual access through the legacy Gemini CLI endpoint (returning UNSUPPORTED_CLIENT).

After applying the local Connect-RPC discovery logic (RetrieveUserQuotaSummary with X-Codeium-Csrf-Token), the Language Server connection succeeds right away and correctly reports both 5h and weekly quotas in the status bar without requiring any gemini-cli fallback credentials.

Looks solid and verified working on real hardware. Thanks for the fix!

@eojonathan

Copy link
Copy Markdown
Contributor Author

📸 Visual Proofs / Demonstration

Here are screenshots from the running desktop application showcasing the implementation in action:

1. Live Quota in Status Bar (Dual-bar Monitor & Provider Menu)

Real-time session (5h) and weekly quota tracking queried via local Language Server RPC, with the official Google Antigravity branding and icon:

Status Bar Dual Bars Live Quota Detail Popup
Status Bar Bars Quota Detail Popup

2. Settings & Account Management

Dedicated Google Antigravity account toggle with official AntigravityIcon and status bar toggle:

Accounts Settings Status Bar Indicators
Accounts Settings Status Bar Settings

@eojonathan

Copy link
Copy Markdown
Contributor Author

Thank you so much for taking the time to test this on macOS arm64 hardware, @hongvincent! 🙌

Really appreciate the confirmation that the Connect-RPC discovery and quota parsing seamlessly picked up the live session (5h) and weekly windows on Apple Silicon. Cheers! 🚀

@eojonathan
eojonathan force-pushed the fix/antigravity-quota-credentials branch from 8aa0a07 to 773fb00 Compare September 8, 2026 11:52

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

ℹ️ No critical issues — one minor suggestion inline.

Reviewed changes (delta against the prior Pullfrog review)

  • Rebased onto current main (bba68b1b) — a second pure rebase: all 13 PR commit subjects are unchanged from the prior reviewed head 8aa0a077, only SHAs changed. The new rate-limit modules, the OAuth extractor/sources, the orchestration examples, and the status-bar components are byte-identical; shared files differ only by main churn (MiniMax endpoint/apiKey, terminal contrast floor, DebouncedSettingsTextInput).
  • Absorbed main's runtime-required catalog — en-runtime-required.json is newly in scope, and the PR now adds its i18n keys to this boot-bundle catalog.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@eojonathan
eojonathan force-pushed the fix/antigravity-quota-credentials branch from 773fb00 to 4885e25 Compare September 12, 2026 20:15

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

✅ No new issues found.

Reviewed changes (delta against the prior pullfrog review)

  • Pruned orphaned localization keys — removed the dead Gemini-branded AccountsPane keys (0c64dc2a64, 0c7f915b01, 96f3649526, 973741a871, c2aee76420, d676c41fc6), the orphaned useAntigravityCredentialsExp, and the accounts.search b7c2cee442/bada4a3218/d819755b02 block from en.json and the es/fr/ja/ko/zh locales, so the boot bundle no longer carries stale "Gemini"/"(experimental)" copy.
  • Trimmed the runtime-required catalog — dropped the two SidebarHeader entries (moreActions, workspaces) whose reader was superseded by main's dashboard rewrite; en-runtime-required.json now matches main exactly and drops out of the PR diff.

Verified on this head: the runtime-required generator reports no missing, contradicting, or superfluous entries, and the localization catalog, extraction, and coverage checks all pass.

Pullfrog  | View workflow run | Using openrouter/deepseek/deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

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

Important

The status-bar reset label now interpolates through translate(), but the existing UsageRosterPanel test mock does not, so UsageRosterPanel.test.tsx > uses one shared clock for live reset labels across the roster fails on this head. CI runs that file, so the PR is red until the test is updated.

Reviewed changes (delta against the prior pullfrog review)

  • Re-reviewed the credential-write refactor — saveGeminiCredentials now selects the nested credential object with a ternary and mutates it in one block; confirmed semantics-preserving against the previously reviewed revision (same first-truthy-object pick, same merge fallback, same stringify).
  • Rebased onto current main — force-pushed again; all 15 commit subjects are unchanged and the PR-authored file content matches the previously reviewed revision. The only shared files that differ (en.json + siblings, global-settings-types.ts) differ by main churn only.
  • Ran the focused suites — the rate-limit tests pass (21 tests); the full status-bar suite is 374/375, with the single failure flagged inline.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@@ -77,7 +77,7 @@ function soonestResetLabel(sections: UsageSection[], now: number): string | null
if (resets.length === 0) {
return null
}
return formatResetCountdown(Math.min(...resets) - now)
return formatLocalizedResetCountdown(Math.min(...resets) - now)

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.

This line breaks an existing test. Routing soonestResetLabel through formatLocalizedResetCountdown means the label is interpolated by translate(..., { value0 }), but UsageRosterPanel.test.tsx:15 mocks translate as (_key, fallback) => fallback and discards the options. The row therefore renders the literal Resets in {{value0}}, so expect(markup).toContain('Resets in 2m') (test line 131) fails. Verified: the test passes when this line uses formatResetCountdown and fails with formatLocalizedResetCountdown; the production path itself is correct.

Technical details
# Update the UsageRosterPanel translate mock to interpolate

## Affected sites
- src/renderer/src/components/status-bar/UsageRosterPanel.tsx:80 — calls `formatLocalizedResetCountdown`, which interpolates `{{value0}}` via `translate()`
- src/renderer/src/components/status-bar/UsageRosterPanel.test.tsx:14-16 — `vi.mock('@/i18n/i18n')` returns `fallback` verbatim, dropping the options argument
- src/renderer/src/components/status-bar/UsageRosterPanel.test.tsx:131 — `expect(markup).toContain('Resets in 2m')` is the failing assertion

## Required outcome
- The suite passes on this head: the test's `translate` mock must apply `{{value0}}` interpolation (or the assertion must be adjusted) so it mirrors production. The test file is not part of the PR diff, so it needs a change alongside this line.

## Suggested approach (optional)
- Replace the mock with one that substitutes `{{name}}` tokens from the options argument, e.g. `translate: (_key, fallback, options) => options ? fallback.replace(/\{\{(\w+)\}\}/g, (_m, k) => String(options[k] ?? '')) : fallback`.

…olution

# Conflicts:
#	src/main/rate-limits/gemini-cli-oauth-extractor.ts
#	src/main/rate-limits/gemini-oauth-sources.ts
…ta RPC

# Conflicts:
#	src/main/rate-limits/gemini-usage-fetcher.test.ts
#	src/main/rate-limits/gemini-usage-fetcher.ts
…ng cadence

# Conflicts:
#	src/main/rate-limits/service/service-types.ts
# Conflicts:
#	src/renderer/src/i18n/locales/en.json
# Conflicts:
#	src/renderer/src/components/status-bar/tooltip.tsx
#	src/renderer/src/i18n/locales/en.json
…safety

# Conflicts:
#	src/main/rate-limits/gemini-oauth-sources.ts
#	src/main/rate-limits/gemini-usage-fetcher.test.ts
#	src/main/rate-limits/service/service-types.ts
…Header and PID-scoped CSRF matching

# Conflicts:
#	src/renderer/src/i18n/en-runtime-required.json
…nd runtime catalog

# Conflicts:
#	src/renderer/src/i18n/en-runtime-required.json
@eojonathan
eojonathan force-pushed the fix/antigravity-quota-credentials branch from 5217a39 to ceb2fa3 Compare November 1, 2026 06:32
@nwparker

nwparker commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Thanks for this, @eojonathan, and for keeping it rebased for so long. Main now covers what this PR adds, so I'm closing it as superseded:

If you see a quota case the agy-CLI path misses (for example IDE-only installs), please open an issue with the details. We'd be glad to look at it.

@nwparker nwparker closed this Nov 7, 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

Development

Successfully merging this pull request may close these issues.

3 participants