Repository navigation
fix(usage): read Antigravity's sign-in from the Linux desktop keyring - #1776
Conversation
Read Antigravity's Secret Service item on Linux and retain the existing file fallback and expiry-based selection. Add focused regression coverage and a changelog entry. Fixes #1103
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Merge Risk: 🔵 Low · up to
|
|
Merge pass. A gate reviewer on a different model from the author's reviewed this PR, and I checked it myself. Approved, no blocking findings.
Accepted tradeoff: the lookup isn't gated on Antigravity being installed, so every Linux discovery runs
Not tested against a real GNOME Keyring: the tests inject the All required checks are green and no review thread is open. |
Change
On Linux, the Antigravity usage meter now also finds its sign-in when the Antigravity CLI keeps it in the desktop keyring (GNOME Keyring / Secret Service) and there is no
antigravity-oauth-tokenfile.Fixes #1103
Cause
fromKeychain()inserver/usage.tsreturns nothing unless the platform is macOS. Antigravity's discovery went through it, so on Linux only the token file was ever read. The CLI's go-keyring item on Linux is a Secret Service item withservice=geminiandusername=antigravity, the attributes the issue reports.What changed
server/usage.ts: on Linux only, Antigravity reads that item withsecret-tool lookup service gemini username antigravity, through the existingrunCommand.secret-tool, a non-zero exit or the 5 s timeout gives no credential and no error.antigravitySignInparser as the macOS keychain read, including itsgo-keyring-base64:form.secret-toolmay show the desktop's unlock prompt at that rate.Checks
HERDR_TEST_MODE=unit bun test server/usage.test.ts: 62 pass, 0 fail. The new Linux cases are:secret-toolmissing or failing, which gives no Antigravity and no error;With the old discovery restored, the keyring-only and keyring-preferred cases fail.
bun run typecheck: passes.bun run check fast: passes (unit 6258 pass, 0 fail, 13 skip in 443 files, 8 at a time, 57.7s).Not run against a real GNOME Keyring: the tests inject the
secret-tooloutput, as the existing macOS keychain tests injectsecurity.Outside PRs that touch the same files
The outside PR #1678 (Gemini quotas from the Antigravity CLI) also edits
server/usage.tsandserver/usage.test.tsand will need a rebase after this one.