fix(oauth): scope antigravity header fixes to loadCodeAssist/onboardUser only

Google fingerprints User-Agent/Client-Metadata on loadCodeAssist and
onboardUser, silently refusing to provision a cloudaicompanionProject
when they don't match the real IDE. Split antigravity's headers out of
the shared gemini-cli constants instead of overwriting them, so the fix
doesn't touch gemini-cli or any other provider.

Inspired by #3000 (thanks @stoXmod for flagging the resource-exhausted
issue), rewritten to keep gemini-cli untouched.
This commit is contained in:
decolua
2026-08-05 16:40:09 +07:00
parent 41588bea01
commit 35f86e5828
5 changed files with 15 additions and 12 deletions

View File

@@ -39,13 +39,10 @@ const antigravity = {
return await response.json();
},
postExchange: async (tokens) => {
// Numeric enums matching Antigravity binary ClientMetadata
const loadHeaders = {
"Authorization": `Bearer ${tokens.access_token}`,
"Content-Type": "application/json",
"User-Agent": ANTIGRAVITY_CONFIG.loadCodeAssistUserAgent,
"X-Goog-Api-Client": ANTIGRAVITY_CONFIG.loadCodeAssistApiClient,
"Client-Metadata": ANTIGRAVITY_CONFIG.loadCodeAssistClientMetadata,
"x-request-source": "local",
};
const metadata = getOAuthClientMetadata();

View File

@@ -85,8 +85,6 @@ export class AntigravityService {
"Authorization": `Bearer ${accessToken}`,
"Content-Type": "application/json",
"User-Agent": this.config.loadCodeAssistUserAgent,
"X-Goog-Api-Client": this.config.loadCodeAssistApiClient,
"Client-Metadata": this.config.loadCodeAssistClientMetadata,
};
}