Skip to content

feat: real Antigravity usage, zh-TW UI, and renderer diagnostics shim - #9360

Open
RX5950XT wants to merge 1 commit into
stablyai:mainfrom
RX5950XT:feat/antigravity-usage-zh-tw
Open

RX5950XT wants to merge 1 commit into
stablyai:mainfrom
RX5950XT:feat/antigravity-usage-zh-tw

Conversation

@RX5950XT

@RX5950XT RX5950XT commented Jul 18, 2026 •

Copy link
Copy Markdown

Summary

  • Read real Antigravity quota from the Windows Credential Manager entry instead of mirroring Gemini usage, with separate Claude/Gemini 5-hour and weekly windows in the status bar.
  • Add Traditional Chinese (zh-TW) as a first-class UI locale, including locale-aware font fallbacks and catalog parity.
  • Rebase onto current main and harden the implementation for cancellation, partial API responses, authentication refresh, and stale-data handling.

Implementation notes

  • Credential and HTTP work is cancellable, runs independently from the other providers, and keeps the Windows credential lookup from delaying their results.
  • Quota summary and model fallback requests run in parallel; HTTP 401 remains distinct so refresh is attempted, metadata-only quota entries are ignored, and omitted windows are not restored with a fresh age.
  • The renderer-wide Node builtin shim and import rewriting were removed after confirming the existing browser-safe dependency resolution builds successfully.
  • Traditional Chinese system locales include Taiwan, Hong Kong, Macau, and Hant-script tags; <html lang> updates only after the latest lazy catalog activation succeeds.

Validation

  • 163 focused rate-limit, status-bar, and locale tests passed.
  • pnpm run typecheck passed.
  • Changed-file oxlint and oxfmt checks passed.
  • pnpm run verify:localization-catalog passed.
  • pnpm run check:max-lines-ratchet passed.
  • pnpm run build:electron-vite passed.

Platform and security

Antigravity quota is currently Windows-only because it reads the desktop host Credential Manager entry. Credentials remain read-only and in memory; token refresh uses the optional OAuth client environment configuration and otherwise relies on the current access token stored by Antigravity.

Contributor: @RX5950XT

ELI5

Antigravity usage is read from real Windows credential data instead of faking Gemini numbers, with separate time windows in the status bar. Traditional Chinese (zh-TW) is also a full UI language option.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change adds direct Antigravity credential reading, API access, quota aggregation, token refresh, and rate-limit service integration. It also adds the antigravityAuthConfigured state used by renderer visibility and status-bar behavior. Traditional Chinese support is added across shared locale resolution, lazy loading, language selection, translations, document language synchronization, and font styling. Tests cover credentials, quota aggregation, fetching, service behavior, state defaults, and locale handling.

Merge Risk: 🔵 Low · up to c699f

The PR adds real Windows credential-backed usage reporting and OAuth refresh behavior, plus Traditional Chinese UI support. It is broadly mergeable with follow-up to correct the CSS lint violation and confirm that any OAuth client secret is not distributed insecurely with desktop installations.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description provides useful implementation, validation, security, platform, and ELI5 details, but it omits several required template sections. It does not include a linked issue, visual proof for … Add the required template sections and complete them. Include a valid issue reference after “Fixes #”. Attach before-and-after screenshots or videos for the status bar and Traditional Chinese UI changes. Document manual and automated testin…
Docstring Coverage ⚠️ Warning Docstring coverage is 12.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 50 functions across 39 files. (6 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the three primary changes: real Antigravity usage, Traditional Chinese UI support, and renderer diagnostics shim removal.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description provides useful implementation, validation, security, platform, and ELI5 details, but it omits several required template sections. It does not include a linked issue, visual proof for the UI changes, the required testing checklist, AI disclosure, review, agent skill boundary, notes, or the final checklist.

Resolution

Add the required template sections and complete them. Include a valid issue reference after “Fixes #”. Attach before-and-after screenshots or videos for the status bar and Traditional Chinese UI changes. Document manual and automated testing, including tested platforms. Add the AI disclosure, review, agent skill upstream boundary, notes, and checklist sections.

Full details: Docstring Coverage

Explanation

Docstring coverage is 12.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 50 functions across 39 files. (6 skipped: 6 unsupported.)

  • Fix all pre-merge checks with AI

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

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 5


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 70a679a0-d0ae-4de3-8db5-c881d393697d

📥 Commits

Reviewing files that changed from the base of the PR and between 54cb772 and 1b8c0163515a8381795a2a495c51e3318a1adca8.

📒 Files selected for processing (36)
  • electron.vite.config.ts
  • src/main/i18n/main-i18n.ts
  • src/main/rate-limits/antigravity-api-client.ts
  • src/main/rate-limits/antigravity-credentials.test.ts
  • src/main/rate-limits/antigravity-credentials.ts
  • src/main/rate-limits/antigravity-quota-aggregation.test.ts
  • src/main/rate-limits/antigravity-quota-aggregation.ts
  • src/main/rate-limits/antigravity-usage-fetcher.test.ts
  • src/main/rate-limits/antigravity-usage-fetcher.ts
  • src/main/rate-limits/service.test.ts
  • src/main/rate-limits/service.ts
  • src/renderer/src/assets/main.css
  • src/renderer/src/components/settings/appearance-search.ts
  • src/renderer/src/components/stats/GrokUsagePane.test.tsx
  • src/renderer/src/components/status-bar/StatusBar.tsx
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.test.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.ts
  • src/renderer/src/components/status-bar/tooltip.tsx
  • src/renderer/src/i18n/I18nProvider.tsx
  • src/renderer/src/i18n/i18n.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-TW.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/i18n/supported-languages.ts
  • src/renderer/src/shims/diagnostics-channel.ts
  • src/renderer/src/store/slices/rate-limits.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/rate-limit-types.test.ts
  • src/shared/rate-limit-types.ts
  • src/shared/ui-language.test.ts
  • src/shared/ui-language.ts
  • src/shared/ui-locale.test.ts
  • src/shared/ui-locale.ts

Comment thread src/main/rate-limits/antigravity-api-client.ts
Comment thread src/main/rate-limits/antigravity-quota-aggregation.ts
Comment on lines +291 to +323
const byName = new Map(nextBuckets.map((b) => [b.name, b]))
let restored = false
for (const entry of ANTIGRAVITY_BUCKET_ORDER) {
if (byName.has(entry.name)) {
continue
}
const prevBucket = previous?.buckets?.find((b) => b.name === entry.name)
if (prevBucket) {
byName.set(entry.name, prevBucket)
restored = true
}
}

if (!restored) {
return next
}

const buckets = ANTIGRAVITY_BUCKET_ORDER.map((entry) => byName.get(entry.name)).filter(
(b): b is RateLimitBucket => b != null
)
const { session, weekly } = deriveAntigravitySessionWeekly(buckets)
return {
...next,
session,
weekly,
buckets,
error: next.error,
status: buckets.length > 0 ? 'ok' : next.status,
usageMetadata: {
...next.usageMetadata,
// Why: restored bars are last-known values, not a fresh official sample.
lastSuccessfulSource: previous?.usageMetadata?.source ?? next.usageMetadata?.source
}

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.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Do not refresh restored buckets’ age indefinitely.

Each partial response restores old buckets but retains next.updatedAt and changes the result to ok. On the next refresh, those restored values are treated as newly successful again, so an omitted window can survive indefinitely—even beyond its reset or across credential changes.

Track freshness per restored bucket, or otherwise preserve and enforce the original successful timestamp instead of promoting the merged snapshot as fully fresh.

Comment thread src/main/rate-limits/service.ts Outdated
Comment on lines +12 to +51
runStores: <T>(fn: () => T, ..._args: unknown[]) => T
}

type TracingChannel = {
hasSubscribers: boolean
subscribe: (..._args: unknown[]) => void
unsubscribe: (..._args: unknown[]) => void
traceSync: <T>(fn: () => T, ..._args: unknown[]) => T
tracePromise: <T>(fn: () => Promise<T>, ..._args: unknown[]) => Promise<T>
traceCallback: <T>(fn: () => T, ..._args: unknown[]) => T
}

function createChannel(): Channel {
return {
hasSubscribers: false,
subscribe() {},
unsubscribe() {},
publish() {},
bindStore() {},
unbindStore() {},
runStores(fn) {
return fn()
}
}
}

function createTracingChannel(): TracingChannel {
return {
hasSubscribers: false,
subscribe() {},
unsubscribe() {},
traceSync(fn) {
return fn()
},
tracePromise(fn) {
return fn()
},
traceCallback(fn) {
return fn()
}

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 | 🟠 Major | ⚡ Quick win

Align API signatures and forward arguments to match Node.js.

The shim's execution methods have incorrect signatures that could lead to runtime crashes:

  1. runStores expects (context, fn[, thisArg[, ...args]]) in Node.js, but the shim expects fn as the first argument. Calling it with a context object will throw TypeError: _context is not a function.
  2. traceSync, tracePromise, and traceCallback drop thisArg and ...args. If a library passes these arguments, fn will not receive them, potentially causing downstream logic to fail.

Update the types and implementations to align with Node.js and forward arguments safely.

🐛 Proposed fixes
-  runStores: <T>(fn: () => T, ..._args: unknown[]) => T
+  runStores: <T>(context: unknown, fn: (...args: any[]) => T, thisArg?: any, ...args: any[]) => T
 }
 
 type TracingChannel = {
   hasSubscribers: boolean
   subscribe: (..._args: unknown[]) => void
   unsubscribe: (..._args: unknown[]) => void
-  traceSync: <T>(fn: () => T, ..._args: unknown[]) => T
-  tracePromise: <T>(fn: () => Promise<T>, ..._args: unknown[]) => Promise<T>
-  traceCallback: <T>(fn: () => T, ..._args: unknown[]) => T
+  traceSync: <T>(fn: (...args: any[]) => T, context?: unknown, thisArg?: any, ...args: any[]) => T
+  tracePromise: <T>(fn: (...args: any[]) => Promise<T>, context?: unknown, thisArg?: any, ...args: any[]) => Promise<T>
+  traceCallback: <T>(fn: (...args: any[]) => T, position?: number, context?: unknown, thisArg?: any, ...args: any[]) => T
 }
 
 function createChannel(): Channel {
   return {
     hasSubscribers: false,
     subscribe() {},
     unsubscribe() {},
     publish() {},
     bindStore() {},
     unbindStore() {},
-    runStores(fn) {
-      return fn()
+    runStores(_context, fn, thisArg, ...args) {
+      return fn.apply(thisArg, args)
     }
   }
 }
 
 function createTracingChannel(): TracingChannel {
   return {
     hasSubscribers: false,
     subscribe() {},
     unsubscribe() {},
-    traceSync(fn) {
-      return fn()
+    traceSync(fn, _context, thisArg, ...args) {
+      return fn.apply(thisArg, args)
     },
-    tracePromise(fn) {
-      return fn()
+    tracePromise(fn, _context, thisArg, ...args) {
+      return fn.apply(thisArg, args)
     },
-    traceCallback(fn) {
-      return fn()
+    traceCallback(fn, _position, _context, thisArg, ...args) {
+      return fn.apply(thisArg, args)
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
runStores: <T>(fn: () => T, ..._args: unknown[]) => T
}
type TracingChannel = {
hasSubscribers: boolean
subscribe: (..._args: unknown[]) => void
unsubscribe: (..._args: unknown[]) => void
traceSync: <T>(fn: () => T, ..._args: unknown[]) => T
tracePromise: <T>(fn: () => Promise<T>, ..._args: unknown[]) => Promise<T>
traceCallback: <T>(fn: () => T, ..._args: unknown[]) => T
}
function createChannel(): Channel {
return {
hasSubscribers: false,
subscribe() {},
unsubscribe() {},
publish() {},
bindStore() {},
unbindStore() {},
runStores(fn) {
return fn()
}
}
}
function createTracingChannel(): TracingChannel {
return {
hasSubscribers: false,
subscribe() {},
unsubscribe() {},
traceSync(fn) {
return fn()
},
tracePromise(fn) {
return fn()
},
traceCallback(fn) {
return fn()
}
runStores: <T>(context: unknown, fn: (...args: any[]) => T, thisArg?: any, ...args: any[]) => T
}
type TracingChannel = {
hasSubscribers: boolean
subscribe: (..._args: unknown[]) => void
unsubscribe: (..._args: unknown[]) => void
traceSync: <T>(fn: (...args: any[]) => T, context?: unknown, thisArg?: any, ...args: any[]) => T
tracePromise: <T>(fn: (...args: any[]) => Promise<T>, context?: unknown, thisArg?: any, ...args: any[]) => Promise<T>
traceCallback: <T>(fn: (...args: any[]) => T, position?: number, context?: unknown, thisArg?: any, ...args: any[]) => T
}
function createChannel(): Channel {
return {
hasSubscribers: false,
subscribe() {},
unsubscribe() {},
publish() {},
bindStore() {},
unbindStore() {},
runStores(_context, fn, thisArg, ...args) {
return fn.apply(thisArg, args)
}
}
}
function createTracingChannel(): TracingChannel {
return {
hasSubscribers: false,
subscribe() {},
unsubscribe() {},
traceSync(fn, _context, thisArg, ...args) {
return fn.apply(thisArg, args)
},
tracePromise(fn, _context, thisArg, ...args) {
return fn.apply(thisArg, args)
},
traceCallback(fn, _position, _context, thisArg, ...args) {
return fn.apply(thisArg, args)
}

@brennanb2025

Copy link
Copy Markdown
Contributor

Taking a look!

@brennanb2025
brennanb2025 force-pushed the feat/antigravity-usage-zh-tw branch from 1b8c016 to 3511d84 Compare July 21, 2026 02:56
@brennanb2025

Copy link
Copy Markdown
Contributor

Thanks for the contribution — I rebased this onto current main and tightened the implementation before taking it over. Antigravity quota reads are now independent and cancellable, preserve 401s for refresh, tolerate one optional quota source failing, ignore metadata-only entries, and no longer carry omitted windows forward with a fresh age; I also removed the redundant renderer-wide Node shim after verifying the existing browser-safe path builds cleanly. Traditional Chinese remains first-class with current catalog parity and safer locale activation, and the focused 163 tests, typecheck, changed-file lint/format checks, max-lines gate, localization catalog check, and desktop build pass.

@nwparker nwparker added the enhancement New feature or request label Jul 27, 2026
Rebase the stalled stablyai#9360 work onto current main. Read Antigravity quota from Windows Credential Manager instead of mirroring Gemini, and add Traditional Chinese as a first-class UI locale.

Co-authored-by: Brennan Benson <79079362+brennanb2025@users.noreply.github.com>
@RX5950XT
RX5950XT force-pushed the feat/antigravity-usage-zh-tw branch from 3511d84 to c699fa7 Compare August 28, 2026 20:30
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Note

The previously reviewed commits are no longer reachable (likely due to a force-push or rebase), so CodeRabbit is performing a full review instead of an incremental one. This review may take a little longer.

@RX5950XT

Copy link
Copy Markdown
Author

Rebased onto current main (about 2500 commits of drift, including merge conflicts).

What changed in this refresh:

  • Antigravity usage still reads Windows Credential Manager (gemini:antigravity) instead of mirroring Gemini
  • zh-TW catalog pruned to current English key parity (missing keys still fall back to English)
  • Dropped antigravity-usage-mirror now that the independent fetch path exists
  • Plugin language packs / current rate-limit service orchestration kept

Ready for another look when you have time.

@greptile-apps

greptile-apps Bot commented Aug 28, 2026

Copy link
Copy Markdown

Greptile Summary

The PR replaces mirrored Gemini data with Windows Credential Manager-backed Antigravity quota retrieval and adds Traditional Chinese as a built-in locale.

  • Adds cancellable Antigravity credential lookup, OAuth refresh, multi-host quota requests, quota aggregation, and status-bar presentation.
  • Extends shared rate-limit state and service orchestration with Antigravity authentication durability.
  • Adds zh-TW locale selection, lazy catalogs, system-locale mapping, document language updates, and locale-specific font fallbacks.
  • Adds focused tests for credential parsing, quota aggregation, refresh behavior, provider visibility, and locale resolution.

Confidence Score: 4/5

The PR appears safe to merge, with a non-blocking responsiveness issue when Antigravity retries keep the shared rate-limit refresh cycle occupied.

Other provider state is published independently, but manual and queued refresh completion still waits for Antigravity's sequential multi-host timeout path.

Files Needing Attention: src/main/rate-limits/service.ts, src/main/rate-limits/antigravity-api-client.ts

Important Files Changed

Filename Overview
src/main/rate-limits/antigravity-api-client.ts Adds timeout-bound OAuth and quota API requests with project/body and multi-host fallbacks; the sequential fallback depth can prolong the enclosing refresh cycle.
src/main/rate-limits/antigravity-credentials.ts Adds a cancellable, read-only Windows Credential Manager probe and validates the returned OAuth credential shape.
src/main/rate-limits/antigravity-quota-aggregation.ts Converts quota summary and model fallback responses into separate Claude/Gemini 5-hour and weekly buckets.
src/main/rate-limits/antigravity-usage-fetcher.ts Coordinates credentials, project discovery, quota requests, one authentication refresh attempt, and explicit failure metadata.
src/main/rate-limits/service.ts Integrates independent Antigravity polling and durability state, but retains the shared fetch lock until its potentially long retry chain finishes.
src/renderer/src/components/status-bar/StatusBar.tsx Presents Antigravity family buckets in compact and verbose status-bar modes and bases visibility on credential durability.
src/renderer/src/i18n/I18nProvider.tsx Updates document language only after the latest requested lazy catalog activation completes.
src/shared/ui-locale.ts Maps Taiwan, Hong Kong, Macau, and Hant Chinese locale tags to the new Traditional Chinese catalog.
src/renderer/src/i18n/locales/zh-TW.json Adds the complete Traditional Chinese translation catalog.

Sequence Diagram

sequenceDiagram
  participant UI as Renderer status bar
  participant S as RateLimitService
  participant C as Windows Credential Manager
  participant A as Antigravity APIs
  S->>C: Read gemini:antigravity credential
  par Existing providers
    S->>S: Fetch and publish provider results
  and Antigravity
    C-->>S: Access and refresh tokens
    S->>A: loadCodeAssist
    par Quota requests
      S->>A: retrieveUserQuotaSummary
    and Model fallback
      S->>A: fetchAvailableModels
    end
    A-->>S: Quota windows
  end
  S->>S: Aggregate Claude/Gemini 5h and weekly buckets
  S-->>UI: Push rate-limit state
Loading

Reviews (1): Last reviewed commit: "feat: real Antigravity usage and zh-TW U..." | Re-trigger Greptile

Comment on lines +1897 to +1900
const [antigravityResult, grokResult] = await Promise.all([
antigravityResultPromise,
grokResultPromise
])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Antigravity Holds Refresh Lock

If the Credential Manager or quota endpoints are slow or unavailable, the full-provider cycle retains isFetching while Antigravity performs its sequential timeout-bound retries. Manual refresh remains pending, forced refreshes queue behind it, and ordinary polls are skipped for up to several minutes even though the other provider results have already been published.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@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: a3d94456-d5e9-4043-9c02-0de89b32de20

📥 Commits

Reviewing files that changed from the base of the PR and between df95f03 and c699fa7.

📒 Files selected for processing (45)
  • src/main/codex-accounts/service-reset-credit-test-fixtures.ts
  • src/main/i18n/main-i18n.ts
  • src/main/rate-limits/antigravity-api-client.ts
  • src/main/rate-limits/antigravity-credentials.test.ts
  • src/main/rate-limits/antigravity-credentials.ts
  • src/main/rate-limits/antigravity-quota-aggregation.test.ts
  • src/main/rate-limits/antigravity-quota-aggregation.ts
  • src/main/rate-limits/antigravity-usage-fetcher.test.ts
  • src/main/rate-limits/antigravity-usage-fetcher.ts
  • src/main/rate-limits/antigravity-usage-mirror.test.ts
  • src/main/rate-limits/antigravity-usage-mirror.ts
  • src/main/rate-limits/rate-limit-service-test-harness.ts
  • src/main/rate-limits/service-account-target-selection.test.ts
  • src/main/rate-limits/service-antigravity-usage.test.ts
  • src/main/rate-limits/service-inactive-account-previews.test.ts
  • src/main/rate-limits/service-live-claude-usage.test.ts
  • src/main/rate-limits/service-minimax-usage.test.ts
  • src/main/rate-limits/service-refresh-orchestration.test.ts
  • src/main/rate-limits/service-window-activation.test.ts
  • src/main/rate-limits/service.ts
  • src/renderer/src/assets/main.css
  • src/renderer/src/components/settings/appearance-search.ts
  • src/renderer/src/components/stats/GrokUsagePane.test.tsx
  • src/renderer/src/components/status-bar/StatusBar.tsx
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.test.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.ts
  • src/renderer/src/components/status-bar/tooltip.tsx
  • src/renderer/src/i18n/I18nProvider.test.tsx
  • src/renderer/src/i18n/I18nProvider.tsx
  • src/renderer/src/i18n/i18n.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-TW.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/i18n/supported-languages.ts
  • src/renderer/src/store/slices/rate-limits.ts
  • src/renderer/src/web/preload-api/web-rate-limits-api.ts
  • src/shared/rate-limit-types.test.ts
  • src/shared/rate-limit-types.ts
  • src/shared/ui-language.test.ts
  • src/shared/ui-language.ts
  • src/shared/ui-locale.test.ts
  • src/shared/ui-locale.ts
💤 Files with no reviewable changes (2)
  • src/main/rate-limits/antigravity-usage-mirror.ts
  • src/main/rate-limits/antigravity-usage-mirror.test.ts
🚧 Files skipped from review as they are similar to previous changes (22)
  • src/renderer/src/i18n/locales/es.json
  • src/shared/rate-limit-types.ts
  • src/renderer/src/i18n/i18n.ts
  • src/shared/rate-limit-types.test.ts
  • src/renderer/src/components/settings/appearance-search.ts
  • src/shared/ui-language.test.ts
  • src/renderer/src/components/status-bar/tooltip.tsx
  • src/renderer/src/store/slices/rate-limits.ts
  • src/shared/ui-locale.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.test.ts
  • src/shared/ui-language.ts
  • src/main/i18n/main-i18n.ts
  • src/renderer/src/components/status-bar/StatusBar.tsx
  • src/shared/ui-locale.test.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.ts
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/components/stats/GrokUsagePane.test.tsx
  • src/renderer/src/i18n/supported-languages.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/ko.json
  • src/main/rate-limits/antigravity-api-client.ts

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

(uneven stroke weight). Pin one CJK family per Chinese locale. */
:root:lang(zh) {
--app-font-family:
'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei',

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use the configured lowercase font keyword.

Stylelint rejects BlinkMacSystemFont under value-keyword-case. Change both occurrences to blinkmacsystemfont so the lint gate passes.

Also applies to: 261-261

🧰 Tools
🪛 Stylelint (17.14.0)

[error] 254-254: Expected "BlinkMacSystemFont" to be "blinkmacsystemfont" (value-keyword-case)

(value-keyword-case)

Source: Linters/SAST tools

@nwparker

Copy link
Copy Markdown
Contributor

Takeover verification at c699fa70583ddd53fd7e9098d2bc8270c662b8a8: I reproduced a failure in the quota fallback path, so I have not adopted this implementation.

A failed optional model request discards a successful quota summary. syncQuota in antigravity-usage-fetcher.ts awaits both requests with Promise.all. If retrieveUserQuotaSummary succeeds but fetchAvailableModels rejects (network failure, timeout, or JSON parse error), the outer catch returns an error with no buckets. The successful summary never reaches buildAntigravityRateLimitsFromQuota.

I compiled the exact candidate modules and mocked only Electron networking, passing synthetic credentials directly. A summary containing one Gemini five-hour bucket at 75% remaining produced ok, 25% used when the model lookup returned {models:{}}. Keeping that same successful summary and making only the model lookup throw produced error, session: null, and zero buckets. No real credentials, Credential Manager calls, or external requests were used.

ELI5: Orca gets the usage numbers, but throws them away because a second, optional request failed. Settle the requests independently while preserving caller cancellation and explicit authentication failures; use the valid summary even when the model fallback is unavailable. Add this rejected-request case alongside HTTP-status cases.

Separately, the Windows credential reader adds direct node:child_process, -ExecutionPolicy Bypass, and per-read Add-Type compilation. Those need reconciliation with the current child-process boundary and docs/reference/windows-edr-posture.md before adoption. This is a source review finding, not a claim that I reproduced a Defender alert.

This review does not verify Windows credential lookup, live OAuth quota, or account switching. The independent native agy /usage takeover is tracked in #21654; its live populated OAuth case also remains unverified.

This branch has not been deployed

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants