Skip to content

Claude Code. Any Model. The most powerful AI coding agent now speaks every language.

fix(probe): Antigravity picks its probe model from the account's own list

Jack Rudenko4128e07f331c
diff --git a/packages/cli/src/providers/probe-live.ts b/packages/cli/src/providers/probe-live.ts
index bd8f9d10..11fde5e4 100644
--- a/packages/cli/src/providers/probe-live.ts
+++ b/packages/cli/src/providers/probe-live.ts
@@ -118,7 +118,25 @@ export interface ProbeLinkInput {
*/
const MINIMAL_EFFORT_UNSUPPORTED = new Set(["native-anthropic", "anthropic"]);
-function effortForProvider(provider: string): string {
+/**
+ * Providers where NO effort value is valid for every model they serve, so the
+ * probe sends none and lets each model use its default.
+ *
+ * Antigravity serves Gemini 2.5, Gemini 3 and Claude behind one request shape,
+ * and the probe knows only the provider, never the model family. Measured
+ * 2026-09-19 with the 512-token probe cap:
+ * - "minimal" → `thinkingBudget: 0` on Gemini 2.5, which Antigravity rejects:
+ * `400 INVALID_ARGUMENT` on gemini-2.5-flash and gemini-2.5-flash-lite.
+ * - "low" → a 1024-token budget, which Claude rejects because it is not below
+ * the cap: "`max_tokens` must be greater than `thinking.budget_tokens`".
+ * - no field → 200 on all of them.
+ * Claude Code never sends "minimal" and sends a far larger max_tokens, so user
+ * sessions reach neither failure through this path.
+ */
+const EFFORT_OMITTED = new Set(["antigravity"]);
+
+function effortForProvider(provider: string): string | undefined {
+ if (EFFORT_OMITTED.has(provider)) return undefined;
return MINIMAL_EFFORT_UNSUPPORTED.has(provider) ? "low" : "minimal";
}
@@ -138,6 +156,7 @@ export async function probeLink(
}
const startedAt = Date.now();
+ const probeEffort = effortForProvider(link.provider);
let response: Response;
try {
@@ -174,7 +193,7 @@ export async function probeLink(
// omitting the field both return 200. So EVERY native-anthropic probe
// failed on the payload before the model id was even considered, which
// is why that link could never report `live`.
- output_config: { effort: effortForProvider(link.provider) },
+ ...(probeEffort ? { output_config: { effort: probeEffort } } : {}),
stream: true,
}),
signal: AbortSignal.timeout(timeoutMs),
diff --git a/packages/cli/src/providers/transport/antigravity.ts b/packages/cli/src/providers/transport/antigravity.ts
index e3f2ee49..643133c1 100644
--- a/packages/cli/src/providers/transport/antigravity.ts
+++ b/packages/cli/src/providers/transport/antigravity.ts
@@ -45,6 +45,8 @@ import { credentials } from "../../auth/credentials/authority.js";
import type { RequestAuth } from "../../auth/credentials/types.js";
import { GeminiRequestQueue } from "../../handlers/shared/gemini-queue.js";
import { log, logStderr } from "../../logger.js";
+import type { DiscoveryOutcome } from "./probe-discovery.js";
+import { discoverProviderProbeModel } from "./provider-model-discovery.js";
import type { ProviderTransport, StreamFormat } from "./types.js";
// The backend host comes from `antigravityHost()` — ONE source, shared with the
@@ -351,6 +353,18 @@ export class AntigravityProviderTransport implements ProviderTransport {
return this._activeModelName;
}
+ /**
+ * Pick a probe model from this account's own model list (fetchAvailableModels).
+ *
+ * The cloud catalog marks Antigravity `client_model_selection_required`: the
+ * served set is per account, so no hosted pick can be right for everyone.
+ * Without this method Test All had no candidate at all and reported "no probe
+ * model: transport does not support discovery" for a working subscription.
+ */
+ async discoverProbeModel(exclude?: ReadonlySet<string>): Promise<DiscoveryOutcome> {
+ return discoverProviderProbeModel(this.name, this.displayName, exclude);
+ }
+
getEndpoint(): string {
return antigravityEndpoint();
}