Skip to content

Commit c4b8369

Browse files
lidge-junluvs01
andcommitted
fix(providers): stop probing a models endpoint Antigravity does not serve
The google-antigravity entry ships a static ANTIGRAVITY_MODELS catalog but omitted liveModels. A missing value reads as live, so discovery built ${baseUrl}/models against an endpoint that does not implement it and reported permanent failure. Inference worked the whole time, which is what made the false negative confusing: the provider was fine and the dashboard said it was not. liveModels: false makes the static branch engage at catalog/provider-fetch.ts:451, and management reports discovery as disabled rather than failed at management/provider-routes.ts:84,:90. The regression test forces a credential-bearing path on purpose. The no-token OAuth fallback would short-circuit before any probe and let the test pass with the flag removed — vacuous. Ablated: without the flag it fails with 1 probe where 0 are expected. Registry flag only, cherry-picked from PR #744 by @luvs01. That PR also reworks OAuth reconciliation and persisted provider settings, which is a maintainer security-review surface and is deliberately not included. Co-authored-by: luvs01 <luvs01@users.noreply.github.com>
1 parent d52aa68 commit c4b8369

2 files changed

Lines changed: 39 additions & 1 deletion

File tree

src/providers/registry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ export const PROVIDER_REGISTRY: readonly ProviderRegistryEntry[] = [
796796
// 2026-07-10: defaultModel is frozen pending Vertex-specific Tier-2 evidence; Gemini API
797797
// evidence from ai.google.dev does not establish Vertex publisher availability.
798798
{ id: "google-vertex", label: "Google Vertex AI", adapter: "google", baseUrl: "https://aiplatform.googleapis.com", authKind: "key", dashboardUrl: "https://console.cloud.google.com/vertex-ai", defaultModel: "gemini-3-pro", googleMode: "vertex", jawcodeBundle: "google", extraMetadataAliases: ["gemini-vertex"] },
799-
{ id: "google-antigravity", label: "Google Antigravity", adapter: "google", baseUrl: "https://daily-cloudcode-pa.googleapis.com", authKind: "oauth", dashboardUrl: "https://antigravity.google", models: ANTIGRAVITY_MODELS, defaultModel: "gemini-3.6-flash", modelContextWindows: ANTIGRAVITY_MODEL_CONTEXT_WINDOWS, modelReasoningEfforts: ANTIGRAVITY_MODEL_EFFORTS, googleMode: "cloud-code-assist", jawcodeBundle: "google", extraMetadataAliases: ["antigravity", "gemini-antigravity"] },
799+
{ id: "google-antigravity", label: "Google Antigravity", adapter: "google", baseUrl: "https://daily-cloudcode-pa.googleapis.com", authKind: "oauth", dashboardUrl: "https://antigravity.google", models: ANTIGRAVITY_MODELS, liveModels: false, defaultModel: "gemini-3.6-flash", modelContextWindows: ANTIGRAVITY_MODEL_CONTEXT_WINDOWS, modelReasoningEfforts: ANTIGRAVITY_MODEL_EFFORTS, googleMode: "cloud-code-assist", jawcodeBundle: "google", extraMetadataAliases: ["antigravity", "gemini-antigravity"] },
800800
{ id: "azure-openai", label: "Azure OpenAI", adapter: "azure-openai", baseUrl: "https://{resource}.openai.azure.com/openai", authKind: "key", featured: true, dashboardUrl: "https://portal.azure.com" },
801801
{ id: "ollama", label: "Ollama (local)", adapter: "openai-chat", baseUrl: "http://localhost:11434/v1", authKind: "local", allowPrivateNetworkByDefault: true, allowBaseUrlOverride: true, featured: true, note: "Local — key usually blank" },
802802
{ id: "vllm", label: "vLLM (local)", adapter: "openai-chat", baseUrl: "http://localhost:8000/v1", authKind: "local", allowPrivateNetworkByDefault: true, allowBaseUrlOverride: true, featured: true, note: "Local — key usually blank" },
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { afterEach, describe, expect, test } from "bun:test";
2+
import { gatherRoutedModels } from "../src/codex/catalog";
3+
import { clearModelCache } from "../src/codex/model-cache";
4+
import { providerConfigSeed } from "../src/providers/derive";
5+
import { PROVIDER_REGISTRY } from "../src/providers/registry";
6+
import { withStubbedProviderFetch } from "./helpers/catalog-provider-fetch";
7+
8+
const originalFetch = globalThis.fetch;
9+
10+
afterEach(() => {
11+
globalThis.fetch = originalFetch;
12+
clearModelCache("google-antigravity");
13+
});
14+
15+
describe("Google Antigravity static catalog", () => {
16+
test("registry seed surfaces its static models without live discovery", async () => {
17+
const entry = PROVIDER_REGISTRY.find(provider => provider.id === "google-antigravity")!;
18+
const staticModels = entry.models!;
19+
let fetchCalls = 0;
20+
globalThis.fetch = (() => {
21+
fetchCalls += 1;
22+
return Promise.resolve(Response.json({ data: [{ id: "unexpected-live-model" }] }));
23+
}) as typeof fetch;
24+
25+
const models = await gatherRoutedModels(withStubbedProviderFetch({
26+
providers: {
27+
"google-antigravity": {
28+
...providerConfigSeed(entry),
29+
authMode: "key",
30+
apiKey: "test-token",
31+
},
32+
},
33+
}));
34+
35+
expect(fetchCalls).toBe(0);
36+
expect(models.filter(model => model.provider === entry.id).map(model => model.id).sort()).toEqual([...staticModels].sort());
37+
});
38+
});

0 commit comments

Comments
 (0)