From 042598d9f1cf7688e52152f6604faab00c8f892d Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Mon, 16 Mar 2026 06:46:16 +0000 Subject: [PATCH] Suppress model-switch warning on empty chat threads Don't show "Model changed for this chat" toast when the thread has no messages. On a fresh page load with a stale thread from a previous session, this warning is confusing. The warning is only useful mid-conversation to alert about image compatibility with the new model. When messages.length === 0, silently update the thread's modelId and proceed with loading. --- studio/frontend/src/features/chat/chat-page.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/studio/frontend/src/features/chat/chat-page.tsx b/studio/frontend/src/features/chat/chat-page.tsx index 0e06d89b28..bd506f6b42 100644 --- a/studio/frontend/src/features/chat/chat-page.tsx +++ b/studio/frontend/src/features/chat/chat-page.tsx @@ -352,6 +352,18 @@ export function ChatPage(): ReactElement { .where("threadId") .equals(activeThreadId) .toArray(); + if (messages.length === 0) { + // No history -- just switch silently + await db.threads.update(activeThreadId, { modelId: value }); + await selectModel({ + id: value, + isLora: meta?.isLora, + ggufVariant: meta?.ggufVariant, + isDownloaded: meta?.isDownloaded, + expectedBytes: meta?.expectedBytes, + }); + return; + } const hasImage = messages.some(messageHasImage); const targetModel = modelsFromStore.find((model) => model.id === value); const nonVisionWithImages = hasImage && targetModel?.isVision === false;