fix(antigravity): remove references to autopush endpoint and update fallback logic

This commit is contained in:
Luis Pater
2025-12-10 00:13:20 +08:00
parent b7e382008f
commit f25f419e5a

View File

@@ -27,18 +27,18 @@ import (
) )
const ( const (
antigravityBaseURLDaily = "https://daily-cloudcode-pa.sandbox.googleapis.com" antigravityBaseURLDaily = "https://daily-cloudcode-pa.sandbox.googleapis.com"
antigravityBaseURLAutopush = "https://autopush-cloudcode-pa.sandbox.googleapis.com" // antigravityBaseURLAutopush = "https://autopush-cloudcode-pa.sandbox.googleapis.com"
antigravityBaseURLProd = "https://cloudcode-pa.googleapis.com" antigravityBaseURLProd = "https://cloudcode-pa.googleapis.com"
antigravityStreamPath = "/v1internal:streamGenerateContent" antigravityStreamPath = "/v1internal:streamGenerateContent"
antigravityGeneratePath = "/v1internal:generateContent" antigravityGeneratePath = "/v1internal:generateContent"
antigravityModelsPath = "/v1internal:fetchAvailableModels" antigravityModelsPath = "/v1internal:fetchAvailableModels"
antigravityClientID = "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com" antigravityClientID = "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com"
antigravityClientSecret = "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" antigravityClientSecret = "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"
defaultAntigravityAgent = "antigravity/1.11.5 windows/amd64" defaultAntigravityAgent = "antigravity/1.11.5 windows/amd64"
antigravityAuthType = "antigravity" antigravityAuthType = "antigravity"
refreshSkew = 3000 * time.Second refreshSkew = 3000 * time.Second
streamScannerBuffer int = 20_971_520 streamScannerBuffer int = 20_971_520
) )
var randSource = rand.New(rand.NewSource(time.Now().UnixNano())) var randSource = rand.New(rand.NewSource(time.Now().UnixNano()))
@@ -661,7 +661,7 @@ func buildBaseURL(auth *cliproxyauth.Auth) string {
if baseURLs := antigravityBaseURLFallbackOrder(auth); len(baseURLs) > 0 { if baseURLs := antigravityBaseURLFallbackOrder(auth); len(baseURLs) > 0 {
return baseURLs[0] return baseURLs[0]
} }
return antigravityBaseURLAutopush return antigravityBaseURLDaily
} }
func resolveHost(base string) string { func resolveHost(base string) string {
@@ -697,7 +697,7 @@ func antigravityBaseURLFallbackOrder(auth *cliproxyauth.Auth) []string {
} }
return []string{ return []string{
antigravityBaseURLDaily, antigravityBaseURLDaily,
antigravityBaseURLAutopush, // antigravityBaseURLAutopush,
antigravityBaseURLProd, antigravityBaseURLProd,
} }
} }