Repository navigation
fix(antigravity): discover ~/.gemini/bin/agy.exe for OAuth refresh and keep merged Gemini pool - #240
Merged
CodeZeno merged 1 commit intoNov 28, 2026
Conversation
…d keep merged Gemini pool - Include %USERPROFILE%\.gemini\bin\agy.exe (via Windows Known Folders) and %LOCALAPPDATA%\Programs\Antigravity IDE\resources\bin\language_server.exe in installed_oauth_clients(), fixing AuthRequired failures when refreshing expired Antigravity OAuth tokens on installations where agy.exe lives under ~/.gemini/bin instead of %LOCALAPPDATA%\agy\bin. - Cache discovered OAuth client pairings in memory after the first successful scan to avoid re-reading the ~245 MB agy.exe binary on every poll cycle, and log a specific diagnostic message when no installed OAuth client is found. - Retain the merged "Gemini Models" group as a fallback for the main Gemini pool when its description mentions Argon but its buckets use generic gemini-* IDs (gemini-5h / gemini-weekly), matching issue CodeZeno#231. - Add unit tests covering the new OAuth client candidate paths and the merged Gemini pool summary.
CodeZeno
added a commit
that referenced
this pull request
Nov 28, 2026
…live quota summary The OAuth client cache from #240 never expired, so after an Antigravity update that changed the sign-in client, token refresh kept failing until the app restarted. Key the cache on the binary's path, size and modification time: an unchanged install is not read again, an updated or removed one is rescanned. Add a regression test from the retrieveUserQuotaSummary groups reported on #231 and #233, and update the Antigravity provider fixture to the current response shape (one Gemini group whose description lists Argon, plus the Claude and GPT group). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Antigravity OAuth token refresh fails with
AuthRequiredwhenagy.exeis installed under~/.gemini/bin:installed_oauth_clients()only checked%LOCALAPPDATA%\Programs\Antigravity\resources\bin\language_server.exe,%LOCALAPPDATA%\agy\bin\agy.exe, and%ProgramFiles%\Antigravity\resources\bin\language_server.exe. On Windows installations where the Antigravity CLI lives at%USERPROFILE%\.gemini\bin\agy.exe(and the IDE at%LOCALAPPDATA%\Programs\Antigravity IDE),installed_oauth_clients()returned an empty list as soon as the cachedaccess_tokenexpired, causing immediateAuthRequiredfailures (!in the widget).Additionally, scanning the ~245 MB
agy.exebinary from disk on every poll cycle is unnecessary once valid client metadata has been discovered.Merged Gemini pool dropped when its description mentions Argon (see Antigravity Gemini shows "--" in taskbar since the 21 Nov build (no limit is_active, top-level session/weekly unavailable) #231):
When
retrieveUserQuotaSummaryreports a single"Gemini Models"group with genericgemini-*bucket IDs (gemini-5h,gemini-weekly) whose description mentions Argon,is_antigravity_separate_gemini_group()skips it unconditionally, leaving the top-level Gemini pool unavailable (--).Changes
src/poller/antigravity.rs:oauth_client_candidate_paths()and added%USERPROFILE%\.gemini\bin\agy.exe(resolved viaknown_folders::home_dir()withUSERPROFILEfallback) and%LOCALAPPDATA%\Programs\Antigravity IDE\resources\bin\language_server.exe.CACHED_OAUTH_CLIENTS) after the first successful scan so subsequent refreshes avoid re-readingagy.exefrom disk (empty results are not cached so newly installed clients are still picked up).Antigravity OAuth refresh failed: no installed OAuth client found).has_generic_gemini_buckets()) when a group flagged byis_antigravity_separate_gemini_group()uses genericgemini-*bucket IDs (without"argon") and no other Gemini group answered, while keeping dedicated Argon pools (gemini-4-argon-*) isolated.oauth_client_candidate_paths_include_user_gemini_agy_binary.src/poller/tests.rs:antigravity_merged_gemini_pool_that_mentions_argon_still_shows.Verification
cargo fmt --all -- --check— passedcargo clippy --all-targets -- -D warnings— passed (0 warnings)cargo test— 670 passed, 0 failed (6 ignored)cargo build --release— succeeded~/.gemini/bin/agy.exe): OAuth refresh returns200,loadCodeAssistandretrieveUserQuotaSummarysucceed, and the taskbar widget displays both 5h and 7d Antigravity quotas.