Repository navigation
Conversation
Read the agy Google session from the macOS keychain or the CLI token file instead of mirroring Gemini quota, and show Antigravity in the status bar when that native sign-in is present.
|
Understand this PR’s impact Explore downstream dependencies and potential security impact with Blast Radius. 📝 WalkthroughWalkthroughThis change adds Antigravity OAuth discovery from a token file or macOS Keychain, quota-response parsing, token refresh, and rate-limit fetching. The full-cycle service now fetches Antigravity independently from Gemini. Shared state records Antigravity authentication configuration. Status-bar visibility accepts native Antigravity authentication or usage configuration. Tests cover the new authentication, parsing, fetching, service, and visibility paths. Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to Antigravity quota reporting can stop after token expiry or fail despite valid Keychain credentials and fallback endpoints. Resolve these integration failures before merging. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the user impact, implementation, testing, and AI usage, but it omits several required template sections and information. It has no ELI5, What Changed, Why, Review, Agent skill upstream boundary, Notes, or Checklist sections; the linked issue is not provided as a Resolution Complete the required template sections. Add ELI5, What Changed, Why, Review, Agent skill upstream boundary, Notes, and Checklist. Provide a valid linked issue using
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 715b1fc6-f8ce-4fa3-99d2-1a89f101515c
📒 Files selected for processing (24)
src/main/rate-limits/antigravity-oauth-sources.test.tssrc/main/rate-limits/antigravity-oauth-sources.tssrc/main/rate-limits/antigravity-quota-summary.test.tssrc/main/rate-limits/antigravity-quota-summary.tssrc/main/rate-limits/antigravity-usage-fetcher.test.tssrc/main/rate-limits/antigravity-usage-fetcher.tssrc/main/rate-limits/rate-limit-service-test-harness.tssrc/main/rate-limits/service-account-target-selection.test.tssrc/main/rate-limits/service-antigravity-usage.test.tssrc/main/rate-limits/service-inactive-account-previews.test.tssrc/main/rate-limits/service-live-claude-usage.test.tssrc/main/rate-limits/service-minimax-usage.test.tssrc/main/rate-limits/service-refresh-orchestration.test.tssrc/main/rate-limits/service-window-activation.test.tssrc/main/rate-limits/service/service-configuration.tssrc/main/rate-limits/service/service-full-cycle-application.tssrc/main/rate-limits/service/service-full-cycle-preparation.tssrc/main/rate-limits/service/service-state.tssrc/renderer/src/components/status-bar/status-bar-provider-visibility.test.tssrc/renderer/src/components/status-bar/status-bar-provider-visibility.tssrc/renderer/src/components/status-bar/use-status-bar-controller.tssrc/shared/rate-limit-state-factory.tssrc/shared/rate-limit-types.test.tssrc/shared/rate-limit-types.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
| if (fromFile.status !== 'missing') { | ||
| return fromFile |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Try the Keychain when the token file is invalid.
A malformed or unreadable token file returns immediately. This prevents a valid macOS Keychain session from being used.
Continue to readSessionFromKeychain() after a file error. Return the file error only if no valid Keychain session exists.
🧰 Tools
🪛 ast-grep (0.45.3)
[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFile } from 'node:child_process'
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(detect-child-process-typescript)
| const remaining = remainingFraction(bucketValue) | ||
| if (remaining === null) { | ||
| continue |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
#!/bin/bash
set -u
printf '%s\n' '--- target outline ---'
ast-grep outline src/main/rate-limits/antigravity-quota-summary.ts
printf '%s\n' '--- target source ---'
cat -n src/main/rate-limits/antigravity-quota-summary.ts
printf '%s\n' '--- direct references ---'
rg -n -C 3 "antigravity-quota-summary|remainingFraction|parse.*quota|quota.*summary" src test tests 2>/dev/null || trueRepository: stablyai/orca
Length of output: 17293
🤖 get_repo_knowledge executed:
get_repo_knowledge stablyai/orca /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/learnings
Length of output: 25234
🏁 Script executed:
#!/bin/bash
set -u
printf '%s\n' '--- usage fetcher ---'
cat -n src/main/rate-limits/antigravity-usage-fetcher.ts
printf '%s\n' '--- parser tests ---'
cat -n src/main/rate-limits/antigravity-quota-summary.test.ts
printf '%s\n' '--- rate-limit result types and auth reader references ---'
rg -n -C 4 "parseAntigravityQuotaSummary|AntigravityQuotaSummary|status: 'ok'|readAntigravityAuthSession|RateLimitFetchResult" src/main/rate-limits src/sharedRepository: stablyai/orca
Length of output: 42263
Do not silently omit malformed quota buckets.
If a non-disabled bucket has an invalid fraction and another bucket is valid, fetchAntigravityRateLimits() returns status: 'ok' with incomplete data. Return an explicit parse failure for malformed present fields, while keeping missing optional fields distinct from malformed fields.
Source: Learnings
| isAntigravityAccessTokenFresh: (session: { | ||
| accessToken: string | null | ||
| expiresAtMs: number | null | ||
| }) => Boolean(session.accessToken), |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '1,90p' src/main/rate-limits/antigravity-usage-fetcher.test.ts
sed -n '180,215p' src/main/rate-limits/antigravity-oauth-sources.ts
sed -n '80,145p' src/main/rate-limits/antigravity-usage-fetcher.tsRepository: stablyai/orca
Length of output: 4950
🏁 Script executed:
sed -n '1,115p' src/main/rate-limits/antigravity-usage-fetcher.ts
printf '\n--- oauth source bindings ---\n'
sed -n '1,70p' src/main/rate-limits/antigravity-oauth-sources.ts
printf '\n--- all relevant test references ---\n'
rg -n -C 3 'isAntigravityAccessTokenFresh|refreshBundle|refresh|native quota|fetchAntigravityRateLimits' src/main/rate-limits/antigravity-usage-fetcher.test.ts src/main/rate-limits/antigravity-usage-fetcher.tsRepository: stablyai/orca
Length of output: 14419
Preserve the production expiry check in this mock.
The mock treats the fixture token as fresh because accessToken is present. Production treats the same token as stale because it expires in 60 seconds and applies a five-minute skew. The test therefore bypasses tryRefreshTokenFromBundle before the native quota fetch, and its assertions do not detect that omission.
Use the real isAntigravityAccessTokenFresh implementation, or reproduce its expiry calculation. Configure refreshBundle to return a refreshed token so the test still reaches the native fetch assertions.
| async function ensureFreshSession( | ||
| session: AntigravityAuthSession | ||
| ): Promise<AntigravityAuthSession | null> { | ||
| if (isAntigravityAccessTokenFresh(session)) { | ||
| return session | ||
| } | ||
| if (!session.refreshToken) { | ||
| return null | ||
| } | ||
| const refreshed = await tryRefreshTokenFromBundle(session.refreshToken, true) | ||
| if (!refreshed?.accessToken) { | ||
| return null | ||
| } | ||
| return { | ||
| ...session, | ||
| accessToken: refreshed.accessToken, | ||
| refreshToken: refreshed.newRefreshToken ?? session.refreshToken, | ||
| expiresAtMs: refreshed.expiresIn ? Date.now() + refreshed.expiresIn * 1000 : session.expiresAtMs | ||
| } | ||
| } |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift
🔎 Supported by static analysis
🏁 Script executed:
rg -n 'expiresAtMs|expires_in|fetchAll|refreshInterval|ANTIGRAVITY_SESSION_EXPIRED' src/main/rate-limits src/renderer
sed -n '35,60p' src/main/rate-limits/antigravity-usage-fetcher.ts
sed -n '80,105p' src/main/rate-limits/antigravity-usage-fetcher.tsRepository: stablyai/orca
Length of output: 16009
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- service polling ---'
sed -n '1,210p' src/main/rate-limits/service/service-polling.ts
printf '%s\n' '--- full-cycle preparation ---'
sed -n '1,220p' src/main/rate-limits/service/service-full-cycle-preparation.ts
printf '%s\n' '--- antigravity fetcher ---'
sed -n '1,150p' src/main/rate-limits/antigravity-usage-fetcher.ts
printf '%s\n' '--- antigravity auth source ---'
sed -n '1,230p' src/main/rate-limits/antigravity-oauth-sources.ts
printf '%s\n' '--- relevant tests ---'
rg -n -C 5 'ANTIGRAVITY_SESSION_EXPIRED|antigravity|refresh|poll|interval|retry|stale' src/main/rate-limits/*test.ts src/main/rate-limits/service/*test.tsRepository: stablyai/orca
Length of output: 45543
🤖 get_repo_knowledge executed:
get_repo_knowledge stablyai/orca /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/learnings
Length of output: 33158
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- service-polling.ts ---'
sed -n '1,190p' src/main/rate-limits/service/service-polling.ts
printf '%s\n' '--- service-full-cycle-preparation.ts relevant lines ---'
sed -n '70,105p' src/main/rate-limits/service/service-full-cycle-preparation.ts
sed -n '155,200p' src/main/rate-limits/service/service-full-cycle-preparation.ts
printf '%s\n' '--- Antigravity references outside tests ---'
rg -n -g '*.ts' -g '!*.test.ts' 'fetchAntigravityRateLimits|ANTIGRAVITY_SESSION_EXPIRED|readAntigravityAuthSession|hasAntigravityAuthSession|antigravity.*login|login.*antigravity' src/main src/renderer
printf '%s\n' '--- focused Antigravity tests ---'
sed -n '1,180p' src/main/rate-limits/antigravity-usage-fetcher.test.tsRepository: stablyai/orca
Length of output: 13720
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- provider retry configuration ---'
rg -n -C 4 'INDIVIDUALLY_REFRESHABLE_PROVIDERS|antigravity' src/main/rate-limits/service/service-types.ts
printf '%s\n' '--- fetch-cycle result application ---'
rg -n -C 5 'runFetchAllCycle|Promise.allSettled|results|status|updatedAt|antigravity' src/main/rate-limits/service -g '*.ts' -g '!*.test.ts'
printf '%s\n' '--- Antigravity auth writers and user actions ---'
rg -n -C 4 'write.*Antigravity|save.*Antigravity|persist.*Antigravity|refreshToken|antigravity' src/main -g '*.ts' -g '!*.test.ts' | head -n 260Repository: stablyai/orca
Length of output: 41999
Use the Antigravity refresh flow for Antigravity sessions. When the Antigravity access token expires, the periodic full-cycle fetch reaches ensureFreshSession, which passes the Antigravity refresh token to Gemini CLI's tryRefreshTokenFromBundle. An agy-only installation lacks the Gemini OAuth client credentials required by that helper, so retries return ANTIGRAVITY_SESSION_EXPIRED instead of refreshed quota data. The service retries Antigravity through fetchAll(), but every retry repeats the same credential mismatch. Use Antigravity's own refresh endpoint and credential source at this call site.
| const response = await net.fetch(url, { | ||
| method: 'POST', | ||
| headers: { | ||
| 'Content-Type': 'application/json', | ||
| Authorization: `Bearer ${accessToken}`, | ||
| 'User-Agent': 'antigravity' | ||
| }, | ||
| body: '{}', | ||
| signal: AbortSignal.timeout(API_TIMEOUT_MS) | ||
| }) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Continue to the fallback endpoint after a transport failure.
If net.fetch rejects for the first URL because of DNS, connection, or timeout failure, control exits the loop. The second URL is never attempted.
Catch errors inside the loop. Continue to the next URL when another endpoint remains.
| }) | ||
| } | ||
|
|
||
| let session = await ensureFreshSession(auth.session) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '35,115p' src/main/rate-limits/antigravity-usage-fetcher.ts
sed -n '130,180p' src/main/rate-limits/gemini-oauth-sources.tsRepository: stablyai/orca
Length of output: 3834
🏁 Script executed:
set -e
printf '%s\n' '--- imports and function context ---'
sed -n '1,145p' src/main/rate-limits/antigravity-usage-fetcher.ts
printf '%s\n' '--- refresh helper binding and implementation ---'
rg -n "function refreshAccessToken|const refreshAccessToken|export .*refreshAccessToken|refreshAccessToken\\(" src
printf '%s\n' '--- helper imports and nearby source ---'
rg -n -C 8 "export async function tryRefreshTokenFromBundle|import .*tryRefreshTokenFromBundle|from .*gemini-oauth-sources" src/mainRepository: stablyai/orca
Length of output: 9851
🏁 Script executed:
set -e
printf '%s\n' '--- refreshAccessToken ---'
sed -n '80,125p' src/main/rate-limits/gemini-oauth-sources.ts
printf '%s\n' '--- fetcher catch completion ---'
sed -n '140,170p' src/main/rate-limits/antigravity-usage-fetcher.tsRepository: stablyai/orca
Length of output: 1906
Handle the initial token refresh inside the error boundary.
refreshAccessToken returns null for non-OK HTTP responses, but its net.fetch and response.json() calls can reject on transport, timeout, or response-parsing errors. tryRefreshTokenFromBundle does not catch those errors. Because the initial ensureFreshSession call runs before the try block, those failures can make fetchAntigravityRateLimits() reject instead of returning a network error result.
Move the initial refresh into the try block so thrown refresh failures receive failureKind: 'network'. Non-OK HTTP responses will still follow the existing expired-session path.
| // Why: getState() is hot (renderer pushes + mobile snapshots); keep Grok's sync auth-file probe on fetch cycles instead. | ||
| const grokAuthReadResult = readGrokAuthSession() | ||
| this.grokAuthConfigured = grokAuthReadResult.status === 'ok' | ||
| this.antigravityAuthConfigured = hasAntigravityAuthFile() |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Detect Keychain authentication before clearing the configured state.
hasAntigravityAuthFile() only checks the token file. A macOS user authenticated only through Keychain sets antigravityAuthConfigured to false on every cycle. If quota parsing returns unavailable, the application phase does not restore the flag. The renderer can then hide Antigravity or show the setup CTA for a signed-in user.
Use an authentication-presence probe that checks both the token file and Keychain, such as hasAntigravityAuthSession().
Proposed fix
-import { hasAntigravityAuthFile } from '../antigravity-oauth-sources'
+import { hasAntigravityAuthSession } from '../antigravity-oauth-sources'
...
- this.antigravityAuthConfigured = hasAntigravityAuthFile()
+ this.antigravityAuthConfigured = await hasAntigravityAuthSession()There was a problem hiding this comment.
Caution
This PR adds a new direct node:child_process import that fails the repo's child_process import-boundary ratchet test (reproduced locally: new offender plus offender count 156 vs the pin of 155). It needs to route through runProcess/spawnProcess before merge.
Reviewed changes
- Native Antigravity credential reader —
antigravity-oauth-sources.tsreads theagysession from~/.gemini/antigravity-cli/antigravity-oauth-tokenor the macOS keychain (service=gemini,account=antigravity), decodes thego-keyring-base64:payload, and exposes a sync file probe plus an async reader. - Quota client and parser —
antigravity-usage-fetcher.tsrefreshes an expired token and POSTs toretrieveUserQuotaSummaryagainst two base URLs;antigravity-quota-summary.tsmaps the response into five-hour/weekly windows. - Service integration — the full-cycle fetch polls Antigravity directly instead of mirroring Gemini; a new
antigravityAuthConfiguredflag flows through main state into the status bar. - Visibility change — a checked Antigravity item (with
agydetected) is now the durable signal; the Gemini OAuth requirement is removed, and the item counts as configured usage. - Removal — the Gemini→Antigravity mirror is no longer called and its tests were rewritten, but the module itself remains.
ℹ️ Orphaned antigravity-usage-mirror module left behind
Removing deriveAntigravityRateLimits from service-full-cycle-application.ts removed the module's only production importer, but src/main/rate-limits/antigravity-usage-mirror.ts and antigravity-usage-mirror.test.ts are still in the tree and still run. Deleting them keeps the retired mirror from being mistaken for a live path.
Technical details
# Retire the Gemini→Antigravity mirror
## Affected sites
- `src/main/rate-limits/antigravity-usage-mirror.ts` — only referenced by its own test now.
- `src/main/rate-limits/antigravity-usage-mirror.test.ts` — exercises a path no production code reaches.
- `src/main/rate-limits/service/service-full-cycle-application.ts` — dropped the `deriveAntigravityRateLimits` import in this PR.
## Required outcome
- The mirror module and its test are removed, or a live caller is reintroduced. A grep for `deriveAntigravityRateLimits` should return no hits outside the module's own test.
## Open questions for the human
- Is the mirror intended to stay as a fallback for a future provider re-merge, or is native the only path now?ℹ️ Windows sign-in path is unaddressed
The keychain branch is gated on process.platform !== 'darwin', and agy uses the Windows Credential Locker (rather than a file) for credential storage on Windows. The module does read the on-disk token file on every platform, so if agy also writes antigravity-oauth-token on Windows this works — otherwise Antigravity usage is silently unavailable there.
Technical details
# Windows coverage for native Antigravity auth
## Affected sites
- `src/main/rate-limits/antigravity-oauth-sources.ts:140-182` — keychain reads return `missing` off macOS; only the file path is platform-agnostic.
## Required outcome
- Confirm whether `agy` writes `~/.gemini/antigravity-cli/antigravity-oauth-token` on Windows. If it does not, decide whether Windows is out of scope for this PR or needs a Credential Locker reader.
## Open questions for the human
- Is Windows (`agy` via Credential Locker) intended to be covered here, or tracked separately?DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| @@ -0,0 +1,202 @@ | |||
| import { execFile } from 'node:child_process' | |||
There was a problem hiding this comment.
This direct node:child_process import fails the repo's import-boundary ratchet. child-process-import-boundary.test.ts reports this file as a new offender and the offender count rises to 156 against a pin of 155, so CI fails on both assertions. Route the security call through runProcess/spawnProcess from src/shared/child-process (they pin windowsHide and encode .cmd args) instead.
Technical details
# New direct child_process import fails the ratchet
## Affected sites
- `src/main/rate-limits/antigravity-oauth-sources.ts:1` — `import { execFile } from 'node:child_process'`.
- `src/shared/child-process/child-process-import-boundary.test.ts:107-139` — asserts no unlisted offender and `offenders.length === 155`; runs in CI (`ci-shard-timings.json`).
## Verification
Locally reproduced:
- `has no direct importer outside the allowlist` → received `["src/main/rate-limits/antigravity-oauth-sources.ts"]`.
- `holds the offender count at the pin` → 156 > 155.
## Required outcome
- No direct `node:child_process` import; the test passes unmodified (the allowlist only shrinks — do not add an entry or raise the pin).
- Preserve the current `security find-generic-password` behavior and the 3s timeout.
## Suggested approach (optional)
Use `runProcess({ program: 'security', args, timeoutMs: KEYCHAIN_COMMAND_TIMEOUT_MS })` and read the exit code from the resolved result. Note `run-process.ts` never rejects on non-zero exit, which matches how `execSecurity` already treats the result. `src/main/claude-accounts/keychain.ts` is allowlisted precisely because it still imports directly, so do not copy that pattern.| if (!session.refreshToken) { | ||
| return null | ||
| } | ||
| const refreshed = await tryRefreshTokenFromBundle(session.refreshToken, true) |
There was a problem hiding this comment.
This refresh path borrows the Gemini CLI's OAuth client to refresh an Antigravity-issued refresh token, then keeps the result only in memory. Gemini CLI and Antigravity use different OAuth client IDs, and RFC 6749 §6 requires the refresh token to have been issued to the authenticated client, so once the stored Antigravity access token expires this likely returns null and every poll degrades to ANTIGRAVITY_SESSION_EXPIRED — unless Gemini CLI happens to be installed and Google accepts the cross-client refresh. Unlike the Gemini fetcher, nothing writes the refreshed token back, so an expired session also re-refreshes on every poll.
Technical details
# Antigravity token refresh depends on Gemini CLI credentials and never persists
## Affected sites
- `src/main/rate-limits/antigravity-usage-fetcher.ts:39-58` — `ensureFreshSession` calls `tryRefreshTokenFromBundle(session.refreshToken, true)` and returns the new tokens in memory only.
- `src/main/rate-limits/gemini-oauth-sources.ts:150-162` — `tryRefreshTokenFromBundle` reads Gemini CLI `OAUTH_CLIENT_ID`/`OAUTH_CLIENT_SECRET` via `extractOAuthClientCredentials()`.
- `src/main/rate-limits/gemini-cli-oauth-extractor.ts:234-269` — returns `null` when the `gemini` binary/package cannot be found (GUI PATH often lacks it).
- `src/main/rate-limits/gemini-usage-fetcher.ts:163,189-195` — the Gemini path persists refreshed credentials via `saveGeminiCredentials`.
## Evidence
- Gemini CLI client: `681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com`; Antigravity client: `1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com` (distinct).
- RFC 6749 §6: the server must "ensure that the refresh token was issued to the authenticated client".
## Required outcome
- Either verify the cross-client refresh actually works (the PR body notes a live check is still pending), or make the fallback explicit: persist the refreshed access token/refresh token to the same store the session was read from, and/or obtain Antigravity's own client credentials.
- Avoid a refresh request on every poll when the stored record has no expiry; `isAntigravityAccessTokenFresh` returns `true` for `expiresAtMs === null`, so the file-backed path only refreshes after a 401 and then repeats each cycle.
## Open questions for the human
- Was the cross-client refresh observed to succeed against a live account, or is it best-effort? If best-effort, the error copy already tells users to run `agy`, which is fine — but the dead refresh branch should be documented or removed.| return existsSync(getAntigravityOAuthTokenPath(home)) | ||
| } | ||
|
|
||
| export async function hasAntigravityAuthSession(home = homedir()): Promise<boolean> { |
There was a problem hiding this comment.
hasAntigravityAuthSession is exported but never called outside test mocks — production uses the synchronous, file-only hasAntigravityAuthFile. As a result a keychain-only macOS sign-in never reaches antigravityAuthConfigured until a fetch settles, which makes the async helper (and its only consumer, hasAntigravityKeychainItem) dead weight. Either wire it into the preparation path or drop both.
Technical details
# Unused async auth-session probe
## Affected sites
- `src/main/rate-limits/antigravity-oauth-sources.ts:140-160` — `hasAntigravityKeychainItem` + `hasAntigravityAuthSession`; grep shows no production caller.
- `src/main/rate-limits/service/service-state.ts:38` and `service/service-full-cycle-preparation.ts:92` — both use the sync `hasAntigravityAuthFile`.
## Required outcome
- Either remove `hasAntigravityAuthSession`/`hasAntigravityKeychainItem`, or use the async probe where the durable keychain signal is meant to be captured.
## Open questions for the human
- Was the async helper intended to feed `antigravityAuthConfigured` for keychain-only macOS users? Today the flag is correct only after a fetch completes, and is reset from the file each cycle.| // Antigravity's durable signal requires geminiCliOAuthEnabled, so it is | ||
| // already covered by the gemini term above. | ||
| settings?.antigravityAuthConfigured === true || | ||
| settings?.antigravityUsageConfigured === true || |
There was a problem hiding this comment.
Adding antigravityUsageConfigured (the default-on status-bar item) to hasUsageProviderSettings suppresses the usage setup CTA for anyone with agy on PATH, even with no provider signed in — the code comment this PR removed explicitly guarded against that. The chip will still render a "not signed in" message, so this may be intentional, but confirming the empty-state behavior is worth it.
Technical details
# Checked Antigravity item now counts as configured usage
## Affected sites
- `src/renderer/src/components/status-bar/status-bar-provider-visibility.ts:75-76` — `hasUsageProviderSettings` now returns true for `antigravityUsageConfigured`.
- `src/renderer/src/components/status-bar/use-status-bar-controller.ts:105-116` — `antigravityUsageConfigured` is `statusBarItems.includes('antigravity') && isStatusBarItemAvailable(...)`, and the item is in `DEFAULT_STATUS_BAR_ITEMS`.
- `src/renderer/src/components/status-bar/status-bar-provider-visibility.ts:143-181` — `isUsageEmptyState` gates the setup CTA on `hasUsageProviderSettings`.
## Required outcome
- Confirm the empty-state CTA should disappear for `agy`-detected users who have not signed in; if not, gate the CTA on `antigravityAuthConfigured` rather than the checked item.There was a problem hiding this comment.
ℹ️ No new issues in the incremental delta. The prior review's findings are unchanged by this commit and remain open.
Reviewed changes
toWindowbuilds the window explicitly —antigravity-quota-summary.tsreplaced the destructuring spread with an explicit{ usedPercent, windowMinutes, resetsAt, resetDescription }object and defaultswindowMinutestoSESSION_WINDOW_MINUTES. This is behavior-preserving (windowMinutesis always set when the bucket is pushed) and reads as a typing cleanup only.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
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. |

User impact
Antigravity usage in the status bar now comes from a native
agysign-in (macOS keychain or the CLI token file), so a Gemini CLI OAuth opt-in is no longer required for that chip to appear.Implementation
gemini/antigravityin the macOS keychain (go-keyring-base64:…) or~/.gemini/antigravity-cli/antigravity-oauth-token.retrieveUserQuotaSummaryand map five-hour / weekly buckets onto the existing Antigravity provider.Testing
Linked issue
Native Antigravity usage when
agyis signed in on the machine.Visual proof
Pending live install of the local Mac client with this branch.
AI disclosure
Implemented with Grok.