Reduce fingerprint surface to minimize rate limiting by matching what
Antigravity Manager actually sends on content requests.
Changes:
- Remove X-Goog-QuotaUser and X-Client-Device-Id headers (AM doesn't send them)
- Remove X-Goog-Api-Client and Client-Metadata from fingerprint headers (AM only sends User-Agent on content requests)
- Fix ideType: replace random pool (INTELLIJ, ANDROID_STUDIO, etc.) with ANTIGRAVITY/IDE_UNSPECIFIED
- Remove wrong SDK clients (intellij/2024.1, android-studio/2024.1, jetbrains/2024.3) from randomization pools
- Strip extra Client-Metadata fields (osVersion, arch, sqmId) not present in AM
- Force-regenerate saved fingerprints on account load to clear stale data
- Set CODE_ASSIST_METADATA.ideType to ANTIGRAVITY (matching AM)
Replicate Antigravity-Manager's version resolution chain:
1. Remote API (auto-updater endpoint)
2. Changelog page scrape
3. Hardcoded fallback
Version is resolved once at plugin init and propagates to all
headers, fingerprints, and user-agent strings via lazy getters.
saveAccounts() merges incoming storage with existing, which means deleted
accounts get merged back from the existing file. saveAccountsReplace()
writes the storage directly without merge.
This was the actual root cause of #370 - the in-memory sync we added
earlier helps for the current session, but the disk persistence was
still broken.
Same pattern as the enabled toggle bug - delete only updated disk storage
but not the in-memory AccountManager.
Added removeAccountByIndex() method and called it from delete logic.
Fixes#370
The first fix (checking enabled flag in getCurrentAccountForFamily) wasn't
enough because the toggle code only updated disk storage, not the in-memory
AccountManager used for request routing.
Added:
1. setAccountEnabled() method to AccountManager
2. Module-level activeAccountManager reference shared between connect and login
3. Toggle code now syncs both disk storage AND in-memory state
getCurrentAccountForFamily() returned accounts by index without checking
the enabled flag, causing disabled accounts to be selected in sticky mode.
The fix adds an enabled check before returning the account, ensuring
disabled accounts fall through to getNextForFamily() which properly
filters by enabled status.
Fixes#381