mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-10-10 03:28:03 +00:00
fix: resolve OpenAI Compatible embedder provider save validation issue
- Fix validation schema for OpenAI Compatible provider to properly handle model dimension field - Improve validation data preparation to ensure numeric fields are properly converted - Ensure validation errors are displayed to users when required fields are missing - Resolves issue where Save button would not work for OpenAI Compatible provider Fixes #5842
This commit is contained in:
parent
a7771a3c11
commit
a4907b63d5
1 changed files with 14 additions and 1 deletions
|
|
@ -369,7 +369,20 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
|
|||
dataToValidate[key] = "placeholder-valid"
|
||||
}
|
||||
} else {
|
||||
dataToValidate[key] = value
|
||||
// Special handling for model dimension field - ensure it's a number when required
|
||||
if (key === "codebaseIndexEmbedderModelDimension") {
|
||||
// For OpenAI Compatible provider, this field is required and must be a number
|
||||
if (currentSettings.codebaseIndexEmbedderProvider === "openai-compatible") {
|
||||
// Convert to number if it's a string, or use undefined if empty
|
||||
const numValue = typeof value === "string" ? parseInt(value, 10) : (value as number)
|
||||
dataToValidate[key] = isNaN(numValue) ? undefined : numValue
|
||||
} else {
|
||||
// For other providers, it's optional
|
||||
dataToValidate[key] = value
|
||||
}
|
||||
} else {
|
||||
dataToValidate[key] = value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue