fix(ui): don't overwrite vector_store_ids with empty array on model edit

The edit-model form initialized vector_store_ids to [] and then
unconditionally included it in the update payload. Editing any unrelated
field (e.g. temperature) on a model without vector stores would inject
vector_store_ids: [] into the model's litellm_params via the PATCH-merge
backend, which then propagated to inference requests and broke Anthropic
calls.

Mirror the cache_control_injection_points pattern directly below:
only include the field when length > 0, otherwise delete the key from
the payload so PATCH leaves the stored value untouched.
This commit is contained in:
Ryan Crabbe 2026-04-04 10:29:02 -07:00
parent a5322c6efc
commit 91d88737b4
No known key found for this signature in database

View file

@ -265,10 +265,10 @@ export default function ModelInfoView({
if (values.guardrails) {
updatedLitellmParams.guardrails = values.guardrails;
}
if (values.vector_store_ids !== undefined) {
updatedLitellmParams.vector_store_ids = Array.isArray(values.vector_store_ids)
? values.vector_store_ids
: [];
if (values.vector_store_ids?.length > 0) {
updatedLitellmParams.vector_store_ids = values.vector_store_ids;
} else {
delete updatedLitellmParams.vector_store_ids;
}
// Handle cache control settings