From fba3bbe47accac78b54c993ac0f8031d51ce2a79 Mon Sep 17 00:00:00 2001 From: Ryan Crabbe Date: Sat, 4 Apr 2026 10:42:47 -0700 Subject: [PATCH] test(ui): add regression test for vector_store_ids edit-model bug Verifies that saving an edit to a model without vector stores does not inject vector_store_ids into the PATCH payload. The test fails against the pre-fix handler (payload contains vector_store_ids: []) and passes with the length-guard fix. --- .../src/components/model_info_view.test.tsx | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/ui/litellm-dashboard/src/components/model_info_view.test.tsx b/ui/litellm-dashboard/src/components/model_info_view.test.tsx index b2cbbda34aa..79e41508bb0 100644 --- a/ui/litellm-dashboard/src/components/model_info_view.test.tsx +++ b/ui/litellm-dashboard/src/components/model_info_view.test.tsx @@ -552,6 +552,33 @@ describe("ModelInfoView", () => { expect(updatePayload.litellm_params.litellm_credential_name).not.toBe("from-json"); }); + it("should not include vector_store_ids in update payload when model has none", async () => { + // Regression: editing a model without vector stores used to inject + // vector_store_ids: [] into litellm_params, which then propagated to + // inference requests and broke Anthropic calls. + const user = userEvent.setup(); + render(, { wrapper }); + + await waitFor(() => { + expect(screen.getByRole("button", { name: /edit settings/i })).toBeInTheDocument(); + }); + + await user.click(screen.getByRole("button", { name: /edit settings/i })); + + await waitFor(() => { + expect(screen.getByRole("button", { name: /save changes/i })).toBeInTheDocument(); + }); + + await user.click(screen.getByRole("button", { name: /save changes/i })); + + await waitFor(() => { + expect(mockModelPatchUpdateCall).toHaveBeenCalled(); + }); + + const updatePayload = mockModelPatchUpdateCall.mock.calls[0][1]; + expect(updatePayload.litellm_params).not.toHaveProperty("vector_store_ids"); + }); + it("should display health check model field for wildcard models", async () => { const wildcardModelData = { ...defaultModelData,