From 918bc1ea9d02fe3028b1136fa344f5ef680a732f Mon Sep 17 00:00:00 2001 From: Roo Code Date: Thu, 22 Jan 2026 10:26:22 +0000 Subject: [PATCH] fix: prevent false validation error for local Ollama models The validation logic was checking against an empty router models object that was initialized but never populated for Ollama. This caused false validation errors even when models existed locally. Now only validates against router models if they actually contain data, preventing the false error when using local Ollama models. Fixes ROO-581 --- webview-ui/src/components/settings/providers/Ollama.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webview-ui/src/components/settings/providers/Ollama.tsx b/webview-ui/src/components/settings/providers/Ollama.tsx index e94fa04a256..32f99c60255 100644 --- a/webview-ui/src/components/settings/providers/Ollama.tsx +++ b/webview-ui/src/components/settings/providers/Ollama.tsx @@ -64,10 +64,10 @@ export const Ollama = ({ apiConfiguration, setApiConfigurationField }: OllamaPro return undefined // Model is available locally } - // If we have router models data for Ollama - if (routerModels.data?.ollama) { + // Only validate against router models if they actually contain data (not just an empty placeholder) + if (routerModels.data?.ollama && Object.keys(routerModels.data.ollama).length > 0) { const availableModels = Object.keys(routerModels.data.ollama) - // Show warning if model is not in the list (regardless of how many models there are) + // Show warning if model is not in the list if (!availableModels.includes(selectedModel)) { return t("settings:validation.modelAvailability", { modelId: selectedModel }) }