v3.10.8: Fix Re-OAuth buttons, block staging/sandbox for Antigravity, prefer production endpoint

- Fix Linux GUI Re-OAuth: load_oauth_secrets() was undefined, now loads inline
- Fix GLib.idle_add lambda returning truthy tuple (repeated callbacks)
- Proxy: production cloudcode-pa.googleapis.com tried first, sandbox as fallback
- Proxy: 403 SERVICE_DISABLED falls through to next endpoint
- Project discovery validates against production endpoint, not staging
- Antigravity preset base_url changed to production
- Windows GUI project discovery also uses production endpoint
This commit is contained in:
Roman | RyzenAdvanced
2026-05-25 21:57:30 +04:00
Unverified
parent 7bc737d8cc
commit f645e92908
11 changed files with 16485 additions and 2586 deletions

View File

@@ -4812,9 +4812,9 @@ class Handler(http.server.BaseHTTPRequestHandler):
wrapped["requestId"] = f"agent-{uuid.uuid4().hex[:12]}"
endpoints = ([
"https://cloudcode-pa.googleapis.com",
"https://daily-cloudcode-pa.sandbox.googleapis.com",
"https://autopush-cloudcode-pa.sandbox.googleapis.com",
"https://cloudcode-pa.googleapis.com",
] if OAUTH_PROVIDER == "google-antigravity" else [
"https://cloudcode-pa.googleapis.com",
])
@@ -4844,6 +4844,9 @@ class Handler(http.server.BaseHTTPRequestHandler):
except Exception:
pass
if OAUTH_PROVIDER == "google-antigravity":
print(f"[antigravity-endpoint] endpoints={[e.replace('https://','') for e in endpoints]} project={project_id}", file=sys.stderr)
for ep in endpoints:
target = f"{ep}/{url_suffix}"
req = urllib.request.Request(target, data=body_b, headers=headers)
@@ -4860,6 +4863,9 @@ class Handler(http.server.BaseHTTPRequestHandler):
print(f"[{self._session_id}] saved 400 debug request to {debug_path}", file=sys.stderr)
except Exception:
pass
if e.code == 403 and "SERVICE_DISABLED" in err_body[:500] and ep != endpoints[-1]:
print(f"[{self._session_id}] {ep} SERVICE_DISABLED, trying next endpoint", file=sys.stderr)
continue
if e.code == 429 and ep != endpoints[-1]:
print(f"[{self._session_id}] {ep} HTTP 429, trying next endpoint", file=sys.stderr)
continue