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
TypeScript a2aai-agentsai-gatewayanthropicclaudeclaude-codeclinecodexcopilotcursordeepseekfree-aigeminikimillm-gatewaymcpopenaiopenai-proxyqwentoken-saver
feat: use getModelInfo for proper custom provider resolution in availability checks
nyatoru619c99ce4c00
diff --git a/src/sse/handlers/chat.ts b/src/sse/handlers/chat.tsindex 3ff2901338..878c87c9dd 100644--- a/src/sse/handlers/chat.ts+++ b/src/sse/handlers/chat.ts@@ -156,13 +156,14 @@ export async function handleChat(request: any, clientRawRequest: any = null) {// Pre-check function: skip models where all accounts are in cooldown// Uses modelAvailability module for TTL-based cooldownsconst checkModelAvailable = async (modelString: string) => {- const parsed = parseModel(modelString);- const provider = parsed.provider;+ // Use getModelInfo to properly resolve custom prefixes+ const modelInfo = await getModelInfo(modelString);+ const provider = modelInfo.provider;if (!provider) return true; // can't determine provider, let it try// Check domain-level availability (cooldown)- if (!isModelAvailable(provider, parsed.model || modelString)) {- log.debug("AVAILABILITY", `${provider}/${parsed.model} in cooldown, skipping`);+ if (!isModelAvailable(provider, modelInfo.model || modelString)) {+ log.debug("AVAILABILITY", `${provider}/${modelInfo.model} in cooldown, skipping`);return false;}