diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 0e03b75324..8c95b6d2d8 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -2313,6 +2313,13 @@ ? chatContent.models : [chatContent.models ?? '']; + // An empty model list is not evidence that the chat's models are gone. + if ($models.length > 0) { + selectedModels = selectedModels.filter((modelId) => + $models.map((m) => m.id).includes(modelId) + ); + } + if (!($user?.role === 'admin' || ($user?.permissions?.chat?.multiple_models ?? true))) { selectedModels = selectedModels.length > 0 ? [selectedModels[0]] : ['']; }