The falsy check !result.thinkingBudget treated thinkingBudget: 0 as missing,
allowing the generationConfig fallback to overwrite it. Use explicit
=== undefined check instead. Adds test for the edge case.
Co-authored-by: greptile[bot] <greptile[bot]@users.noreply.github.com>
OpenCode passes variant thinking config in generationConfig rather than
providerOptions, causing extractVariantThinkingConfig to always return
undefined and the budget to fall back to the default 32768.
Add generationConfig as a second parameter to extractVariantThinkingConfig.
The function now checks providerOptions first (preserving existing behavior),
then falls back to generationConfig.thinkingConfig when providerOptions
yields no thinking configuration.
The x-goog-user-project header causes 403 PERMISSION_DENIED on BOTH
Daily and Prod endpoints (verified with live testing on 11 models).
Previously, the fix only stripped this header for 'antigravity' style.
Now it strips unconditionally for all headerStyles including 'gemini-cli'.
Error message: 'Cloud Code Private API has not been used in project
{user_project} before or it is disabled'
Addresses PR review feedback from @NoeFabris.
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)
- Strip x-goog-user-project header ONLY for antigravity headerStyle (Daily endpoint)
- Keep the header for gemini-cli style (Prod endpoint) where it may be needed for billing/quota
- Add test coverage for both headerStyle behaviors
Root cause:
The x-goog-user-project header (added by OpenCode/AI SDK) causes 403 Forbidden
errors on the Daily sandbox endpoint. This triggers fallback to Prod endpoint,
but claude-opus-4-6-thinking is only available on Daily, resulting in 404 errors.
By stripping this header only for antigravity requests, Daily endpoint works
while preserving potential billing/quota functionality for gemini-cli requests.
Fixes#410
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