Claude Code. Any Model. The most powerful AI coding agent now speaks every language.
fix(probe): Gemini's effort, a parameter mistaken for a model, and Mistral's list
Jack Rudenko7d89795c91bd
diff --git a/packages/cli/src/handlers/shared/model-unsupported.ts b/packages/cli/src/handlers/shared/model-unsupported.tsindex fe1f5ace..b0bc78bd 100644--- a/packages/cli/src/handlers/shared/model-unsupported.ts+++ b/packages/cli/src/handlers/shared/model-unsupported.ts@@ -64,6 +64,25 @@ const UNSUPPORTED_PHRASES = ["no such model",] as const;+/**+ * "not supported" with a PARAMETER as its subject, which is a different fault.+ *+ * The phrase list above is matched anywhere in the body, and "not supported" is+ * the loosest entry in it. Gemini answers a thinking level its model does not+ * take with `400 "Thinking level MINIMAL is not supported for this model."`+ * (measured 2026-09-19 on gemini-3.8-flash). The model is real, reachable and+ * carried; only the one field is wrong. Matching it as model-unsupported told+ * the reader to "Verify model name", which sends them to check a name that is+ * already correct — the same wrong-direction failure the narrowness note above+ * describes, one level down.+ *+ * Keyed on the SUBJECT, not the model: a capability sentence such as "tools are+ * not supported for this model" is also excluded, and rightly so. The model+ * exists there too; what fails is the request's shape.+ */+const PARAMETER_IS_UNSUPPORTED =+ /\b(thinking[ _-]?(level|budget)|reasoning[ _-]?effort|effort|temperature|top[_ ]?[pk]|tool[_ ]?choice|tools?|function[ _-]?calling|parameter|argument|field|image[s]?|audio|video|streaming|stream|json[ _-]?mode|response[ _-]?format|system[ _-]?(prompt|instruction)s?)\b[^.]{0,60}?\b(is|are|was|were)?\s*not supported\b/;+/*** True when this error body says the provider does not carry the requested* model, whatever status it arrived under.@@ -75,6 +94,7 @@ const UNSUPPORTED_PHRASES = [*/export function hasModelUnsupportedWording(errorBody: string): boolean {const lower = (errorBody || "").toLowerCase();+ if (PARAMETER_IS_UNSUPPORTED.test(lower)) return false;return UNSUPPORTED_PHRASES.some((phrase) => lower.includes(phrase));}diff --git a/packages/cli/src/providers/probe-live.ts b/packages/cli/src/providers/probe-live.tsindex 6791394d..d4f0faa0 100644--- a/packages/cli/src/providers/probe-live.ts+++ b/packages/cli/src/providers/probe-live.ts@@ -115,8 +115,16 @@ export interface ProbeLinkInput {* stop a reasoning model spending the whole probe cap on hidden reasoning and* returning 200 with zero visible text. "low" preserves that intent and is* accepted (both verified against the live API).+ *+ * `google` is here for the Gemini 3 thinking levels. Measured 2026-09-19 on the+ * direct API: gemini-3.8-flash answers `400 "Thinking level MINIMAL is not+ * supported for this model"`, while "low" and "high" return 200; gemini-2.5-flash+ * accepts all of them, since 2.5 takes a numeric budget instead. The probe pick+ * for google is a Gemini 3 model, so every Gemini probe failed on its effort+ * field. (Antigravity serves both families and needs no field at all — see+ * EFFORT_OMITTED below.)*/-const MINIMAL_EFFORT_UNSUPPORTED = new Set(["native-anthropic", "anthropic"]);+const MINIMAL_EFFORT_UNSUPPORTED = new Set(["native-anthropic", "anthropic", "google"]);/*** Providers where NO effort value is valid for every model they serve, so thediff --git a/packages/cli/src/providers/provider-definitions.ts b/packages/cli/src/providers/provider-definitions.tsindex 10afde36..eec42914 100644--- a/packages/cli/src/providers/provider-definitions.ts+++ b/packages/cli/src/providers/provider-definitions.ts@@ -1087,6 +1087,14 @@ export const BUILTIN_PROVIDERS: ProviderDefinition[] = [baseUrl: "https://api.mistral.ai",baseUrlEnvVars: ["MISTRAL_BASE_URL"],apiPath: "/v1/chat/completions",+ // Without this, Test All had ONE candidate and no way past it. The catalog's+ // probe pick is `labs-leanstral-1-5`, and a Labs model answers `403 "… is a+ // Labs model. To use Labs models, an admin must enable them in your+ // organization settings"` for any account that has not enabled Labs+ // (measured 2026-09-19). The account's own list answers 200 with 53 models,+ // only 2 of them Labs, so endpoint discovery can walk to a model the account+ // can actually call.+ modelDiscovery: { path: "/v1/models", format: "openai-models-list" },apiKeyEnvVar: "MISTRAL_API_KEY",apiKeyDescription: "Mistral API Key",apiKeyUrl: "https://console.mistral.ai/api-keys",