Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

fix(search): return consistent validation result shape

Jack Coweyb2dc53d18ba3
diff --git a/src/lib/providers/validation.ts b/src/lib/providers/validation.ts
index 050538db2e..5825d71308 100644
--- a/src/lib/providers/validation.ts
+++ b/src/lib/providers/validation.ts
@@ -445,22 +445,22 @@ async function validateAnthropicCompatibleProvider({ apiKey, providerSpecificDat
async function validateSearchProvider(
url: string,
init: RequestInit
-): Promise<{ valid: boolean; error: string | null }> {
+): Promise<{ valid: boolean; error: string | null; unsupported: false }> {
try {
const response = await fetch(url, init);
- if (response.ok) return { valid: true, error: null };
+ if (response.ok) return { valid: true, error: null, unsupported: false };
if (response.status === 401 || response.status === 403) {
- return { valid: false, error: "Invalid API key" };
+ return { valid: false, error: "Invalid API key", unsupported: false };
}
// For provider setup we only need to confirm authentication passed.
// Search providers may return non-auth statuses for exhausted credits,
// rate limiting, or request-shape quirks while still accepting the key.
if (response.status < 500) {
- return { valid: true, error: null };
+ return { valid: true, error: null, unsupported: false };
}
- return { valid: false, error: `Validation failed: ${response.status}` };
+ return { valid: false, error: `Validation failed: ${response.status}`, unsupported: false };
} catch (error: any) {
- return { valid: false, error: error.message || "Validation failed" };
+ return { valid: false, error: error.message || "Validation failed", unsupported: false };
}
}