From 2becdb4a56e7683ae08aef927cec1c6c52dfad5e Mon Sep 17 00:00:00 2001 From: josh <144584931+dancer@users.noreply.github.com> Date: Mon, 18 May 2026 15:08:46 +0100 Subject: [PATCH] fix(chat): drop mistral models and harden title generation (#1498) --- app/(chat)/api/chat/route.ts | 10 +++++++--- lib/ai/models.ts | 22 ++++------------------ 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/app/(chat)/api/chat/route.ts b/app/(chat)/api/chat/route.ts index ac52197..eb70454 100644 --- a/app/(chat)/api/chat/route.ts +++ b/app/(chat)/api/chat/route.ts @@ -244,9 +244,13 @@ export async function POST(request: Request) { ); if (titlePromise) { - const title = await titlePromise; - dataStream.write({ type: "data-chat-title", data: title }); - updateChatTitleById({ chatId: id, title }); + try { + const title = await titlePromise; + dataStream.write({ type: "data-chat-title", data: title }); + updateChatTitleById({ chatId: id, title }); + } catch (_) { + /* non-fatal */ + } } }, generateId: generateUUID, diff --git a/lib/ai/models.ts b/lib/ai/models.ts index 6603dba..eac9514 100644 --- a/lib/ai/models.ts +++ b/lib/ai/models.ts @@ -1,11 +1,11 @@ export const DEFAULT_CHAT_MODEL = "moonshotai/kimi-k2.5"; export const titleModel = { - id: "mistral/mistral-small", - name: "Mistral Small", - provider: "mistral", + id: "moonshotai/kimi-k2.5", + name: "Kimi K2.5", + provider: "moonshotai", description: "Fast model for title generation", - gatewayOrder: ["mistral"], + gatewayOrder: ["fireworks", "bedrock"], }; export type ModelCapabilities = { @@ -31,20 +31,6 @@ export const chatModels: ChatModel[] = [ description: "Fast and capable model with tool use", gatewayOrder: ["bedrock", "deepinfra"], }, - { - id: "mistral/codestral", - name: "Codestral", - provider: "mistral", - description: "Code-focused model with tool use", - gatewayOrder: ["mistral"], - }, - { - id: "mistral/mistral-small", - name: "Mistral Small", - provider: "mistral", - description: "Fast vision model with tool use", - gatewayOrder: ["mistral"], - }, { id: "moonshotai/kimi-k2.5", name: "Kimi K2.5",