Skip to content

Commit d6d00de

Browse files
Fix local model validation error for Ollama models (#10893)
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 Co-authored-by: Roo Code <roomote@roocode.com>
1 parent dc5e765 commit d6d00de

File tree

1 file changed

+3
-3
lines changed
  • webview-ui/src/components/settings/providers

1 file changed

+3
-3
lines changed

webview-ui/src/components/settings/providers/Ollama.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ export const Ollama = ({ apiConfiguration, setApiConfigurationField }: OllamaPro
6464
return undefined // Model is available locally
6565
}
6666

67-
// If we have router models data for Ollama
68-
if (routerModels.data?.ollama) {
67+
// Only validate against router models if they actually contain data (not just an empty placeholder)
68+
if (routerModels.data?.ollama && Object.keys(routerModels.data.ollama).length > 0) {
6969
const availableModels = Object.keys(routerModels.data.ollama)
70-
// Show warning if model is not in the list (regardless of how many models there are)
70+
// Show warning if model is not in the list
7171
if (!availableModels.includes(selectedModel)) {
7272
return t("settings:validation.modelAvailability", { modelId: selectedModel })
7373
}

0 commit comments

Comments
 (0)