mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-09-06 16:15:50 +08:00
fix(antigravity): raise the fallback client version to 2.9.1 (#5175)
Cloud Code resolves newer Antigravity models only for clients reporting at least 2.9.0; below that it answers 404 Requested entity was not found. The offline fallback still reported 2.9.0's predecessor 2.2.1, so every request sent before the hub manifest is first fetched — or from a deployment that cannot reach the manifest at all — asked for models such as gemini-3.7-flash-high with a version the backend rejects. The hub manifest the updater already polls currently publishes 2.9.1, so this only aligns the offline floor with what the online path resolves. The test now asserts the floor rather than a literal, so a future downgrade below 2.9.0 fails instead of silently reintroducing the 404.
This commit is contained in:
@@ -16,7 +16,11 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
antigravityFallbackVersion = "2.2.1"
|
||||
// antigravityFallbackVersion is the client version reported when the hub
|
||||
// manifest has not been fetched yet or cannot be reached. Cloud Code rejects
|
||||
// newer models for clients below 2.9.0, so this floor must stay at or above
|
||||
// that version.
|
||||
antigravityFallbackVersion = "2.9.1"
|
||||
antigravityHubPlatform = "darwin/arm64"
|
||||
antigravityVersionCacheTTL = 6 * time.Hour
|
||||
antigravityFetchTimeout = 10 * time.Second
|
||||
|
||||
@@ -2,6 +2,7 @@ package misc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
@@ -42,8 +43,22 @@ func TestAntigravityLatestVersionUsesCurrentHubFallback(t *testing.T) {
|
||||
defer restore()
|
||||
|
||||
version := AntigravityLatestVersion()
|
||||
if version != "2.2.1" {
|
||||
t.Fatalf("AntigravityLatestVersion() = %q, want %q", version, "2.2.1")
|
||||
if version != antigravityFallbackVersion {
|
||||
t.Fatalf("AntigravityLatestVersion() = %q, want %q", version, antigravityFallbackVersion)
|
||||
}
|
||||
}
|
||||
|
||||
// Cloud Code resolves newer models only for clients reporting at least 2.9.0;
|
||||
// older versions get 404 Requested entity was not found.
|
||||
func TestAntigravityFallbackVersionMeetsBackendFloor(t *testing.T) {
|
||||
const floorMajor, floorMinor = 2, 9
|
||||
|
||||
var major, minor, patch int
|
||||
if _, err := fmt.Sscanf(antigravityFallbackVersion, "%d.%d.%d", &major, &minor, &patch); err != nil {
|
||||
t.Fatalf("antigravityFallbackVersion = %q is not a dotted version: %v", antigravityFallbackVersion, err)
|
||||
}
|
||||
if major < floorMajor || (major == floorMajor && minor < floorMinor) {
|
||||
t.Fatalf("antigravityFallbackVersion = %q, want at least %d.%d.0", antigravityFallbackVersion, floorMajor, floorMinor)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user