Skip to content

Stop opening a Google sign-in page every hour when agy is signed out - #34165

Merged
Jinwoo-H merged 2 commits into
mainfrom
fix/antigravity-usage-signin-latch
Oct 27, 2026
Merged

Jinwoo-H merged 2 commits into
mainfrom
fix/antigravity-usage-signin-latch

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​143 $\color{#cf222e}{\Huge{\mathbf{−}}}$​25 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​118
Prod 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​62 $\color{#cf222e}{\Huge{\mathbf{−}}}$​14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​48

ELI5

If agy is signed out, asking it for usage opens a Google sign-in page in your browser. Orca used to wait an hour and then ask again, so a signed-out user got a new sign-in page about once an hour. Now Orca stops asking on its own until you press refresh or the agy account changes.

What Changed

  • Before: when the usage read hit agy's browser sign-in (Authentication required. Please visit the URL), Orca paused automatic reads for 1 hour, then tried again. Each retry opened another Google sign-in page.
  • After: that result holds automatic reads with no expiry. A manual refresh (status bar refresh, Accounts usage refresh, mobile accounts refresh) still tries once. A change to the native agy credential that Orca sees through its Antigravity account service (switching accounts in Settings, or a new credential seen when the Accounts page reads it) lifts the hold so the next regular poll tries once.
  • Mechanism: reuses the existing retryAtMs poll gate that forced refreshes already bypass. The sign-in result sets it to Number.MAX_SAFE_INTEGER instead of now + 1 h. The host credential backend reports when the credential it reads differs from the last one it read, and the rate-limit service then drops the antigravity retryAtMs. No new timers and no extra keychain or file reads.
  • Status text changes from "Sign in with agy; Orca checks again within an hour, or when you refresh." to "Antigravity usage is not available. Sign in with agy, then refresh usage."

Why

Every automatic retry costs the user a browser tab with a Google sign-in page. Only the user can finish that sign-in, so a timer can't tell when it's worth trying again. A user action or a credential change can.

Linked Issue

Fixes #26484 (the hourly retry that the first fix left)

Visual Proof

N/A. No layout change, only the status text above. Evidence of the behavior change is below.

Testing

PATH wrapper around the real agy: --version goes to the real binary. Every other call logs the call and prints agy's interactive sign-in stderr (Authentication required. Please visit the URL to log in:) with exit 1. No browser was opened.

Real RateLimitService polling (30 s interval, fake Date only, real agy wrapper subprocesses), same script on both trees:

step origin/main probes this branch probes
startup read 1 1
poll inside cooldown 1 1
clock +61 min, 1 poll 2 1
clock +6 h more, 1 poll 3 1
manual refresh 4 2

Dev app on this branch (hidden, isolated profile, wrapper put on the login-shell PATH via ZDOTDIR): a manual refresh ran the wrapper once and published missing-credentials with the hold. Then I removed the wrapper and refreshed manually again. The real logged-in agy ran (exit 0, no sign-in prompt) and the hold was cleared. On this Mac, agy currently answers /usage with "groups":[], so Orca shows "did not report a quota". That is agy's answer and is the same on main.

Unit tests: updated the fetcher expectation and replaced the service test with one that covers holding for 6 h, release on credential change, and manual refresh. pnpm check:changed and the pr.yml static checks pass.

Not exercised for real: the credential-change release in the running app. I did not switch accounts or sign agy out. It is covered by the service unit test, and the host wrapper is 8 lines.

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Notes

  • Cross-platform: the hold is platform independent. Credential-change release works only where the native account service has a backend (macOS, and SSH/WSL file-storage hosts). Elsewhere, refresh lifts the hold.
  • Remote/mobile: retryAtMs is JSON-safe and renderers and mobile never read it. Mixed versions are unaffected.
  • Restarting Orca clears the hold, because rate-limit state is not persisted. That gives one probe at startup, as before.

…er sign-in

A usage read that reaches agy's interactive browser sign-in now holds
automatic reads until the user refreshes usage or Orca sees the native agy
credential change, instead of retrying after one hour and opening another
Google sign-in page each time.
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c9efa13b-746a-4d5c-b7e0-3bebdc296f7f
Commits

Reviewing files that changed from the base of the PR and between c18da1f and b115932.

Files selected for processing: 10
  • src/main/antigravity/native-account-host.test.ts
  • src/main/antigravity/native-account-host.ts
  • src/main/provider-account-services.ts
  • src/main/rate-limits/antigravity-usage-fetcher.ts
  • src/main/rate-limits/service-antigravity-usage.test.ts
  • src/main/rate-limits/service/service-account-refresh.ts
  • src/main/rate-limits/service/service-fetch-policy.ts
  • src/main/rate-limits/service/service-full-cycle-application.ts
  • src/main/rate-limits/service/service-full-cycle-preparation.ts
  • src/main/rate-limits/service/service-state.ts
Files skipped from review as they are similar to previous changes: 1
  • src/main/rate-limits/antigravity-usage-fetcher.ts

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

Walkthrough

Interactive Antigravity sign-in failures now set a fixed retry timestamp instead of a one-hour cooldown. Native credential changes can invalidate Antigravity credential state. Fetch cycles capture a generation and apply Antigravity results only when that generation remains current. Tests cover the hold, credential changes, explicit refreshes, and invalidation during fetch cycles.

Priority: Normal

Severity of issue fixed: Medium

Merge Risk: Minimal · up to b1159

Manual refresh and detected credential changes can release the sign-in hold. No actionable issue remains before merge.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surv… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly describes the main user-facing change: preventing repeated Google sign-in pages when Antigravity is signed out.
Description check Passed The description covers the main template sections, including the user impact, implementation, rationale, linked issue, visual proof, testing, platform considerations, and limitations. The AI Disclosur…
Linked Issues check Passed Issue #26484 is closed. It supplies historical context only. No active directly linked issue supplies coding requirements for this pull request. The reported changes address the historical behavior by…
Out of Scope Changes check Passed The changed production code supports the sign-in hold objective. It updates the hold value and message, detects native credential changes, invalidates stale Antigravity state, and preserves manual ref…
Full details: Description check

Explanation

The description covers the main template sections, including the user impact, implementation, rationale, linked issue, visual proof, testing, platform considerations, and limitations. The AI Disclosure, Review, Agent skill upstream boundary, and Checklist sections are not included, but the core change and verification details are complete.

Full details: Linked Issues check

Explanation

Issue #26484 is closed. It supplies historical context only. No active directly linked issue supplies coding requirements for this pull request. The reported changes address the historical behavior by holding automatic Antigravity sign-in failures, while retaining manual refresh and credential-change release.

Full details: Out of Scope Changes check

Explanation

The changed production code supports the sign-in hold objective. It updates the hold value and message, detects native credential changes, invalidates stale Antigravity state, and preserves manual refresh behavior. The changed tests cover the fetcher, hold duration, credential changes, refresh, and asynchronous generation handling. No unrelated change is demonstrated.

Full details: Docstring Coverage

Explanation

Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 5 functions across 12 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@Jinwoo-H
Jinwoo-H merged commit ad4b9af into main Oct 27, 2026
37 checks passed
@Jinwoo-H
Jinwoo-H deleted the fix/antigravity-usage-signin-latch branch October 27, 2026 05:05
nwparker pushed a commit that referenced this pull request Nov 6, 2026
When Orca's local-account runtime is WSL on Windows, the Antigravity usage
meter still ran the host `agy`, so it showed the wrong account or "not
installed". Route the probe through runWslProcess for the selected distro
(never booting a stopped one), key the unsupported-CLI latch per runtime,
tag readings with the runtime as provenance, and drop another runtime's
last reading instead of keeping it as stale. Settings changes retarget
the fetcher and reread usage.

A WSL target without a distro now names the default through
resolveWslDefaultDistro (registry DefaultDistribution) rather than
listWslDistrosAsync()[0], which skips docker-desktop, falls back to
registry order, and caches the list for the process lifetime.

Ported from #31542 onto current main: reuses main's antigravity fetch
generation (#34165) instead of adding a second one, follows moved WSL and
provider-account-services paths, and keeps only the tests that cover the
new behavior.

Co-authored-by: Jinwoo-H <[email protected]>
nwparker added a commit that referenced this pull request Nov 6, 2026
When Orca's local-account runtime is WSL on Windows, the Antigravity usage
meter still ran the host `agy`, so it showed the wrong account or "not
installed". Route the probe through runWslProcess for the selected distro
(never booting a stopped one), key the unsupported-CLI latch per runtime,
tag readings with the runtime as provenance, and drop another runtime's
last reading instead of keeping it as stale. Settings changes retarget
the fetcher and reread usage.

A WSL target without a distro now names the default through
resolveWslDefaultDistro (registry DefaultDistribution) rather than
listWslDistrosAsync()[0], which skips docker-desktop, falls back to
registry order, and caches the list for the process lifetime.

Ported from #31542 onto current main: reuses main's antigravity fetch
generation (#34165) instead of adding a second one, follows moved WSL and
provider-account-services paths, and keeps only the tests that cover the
new behavior.

Co-authored-by: CAVIN <[email protected]>
Co-authored-by: Jinwoo-H <[email protected]>
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.

Antigravity usage refresh repeatedly opens a Google sign-in page when agy's silent login fails (Windows)

1 participant