Repository navigation
Stop opening a Google sign-in page every hour when agy is signed out - #34165
Conversation
…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.
|
No actionable comments were generated in the recent review.
|
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]>
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]>
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
Authentication required. Please visit the URL), Orca paused automatic reads for 1 hour, then tried again. Each retry opened another Google sign-in page.retryAtMspoll gate that forced refreshes already bypass. The sign-in result sets it toNumber.MAX_SAFE_INTEGERinstead 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 antigravityretryAtMs. No new timers and no extra keychain or file reads.agy; Orca checks again within an hour, or when you refresh." to "Antigravity usage is not available. Sign in withagy, 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:
--versiongoes 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
RateLimitServicepolling (30 s interval, fakeDateonly, real agy wrapper subprocesses), same script on both trees: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 publishedmissing-credentialswith 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/usagewith"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:changedand 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.
Notes
retryAtMsis JSON-safe and renderers and mobile never read it. Mixed versions are unaffected.