mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
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>
This commit is contained in:
parent
dc5e765e9c
commit
d6d00dedec
1 changed files with 3 additions and 3 deletions
|
|
@ -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 })
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue