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.
This commit is contained in:
Ryan Crabbe 2026-04-04 10:42:47 -07:00
parent 91d88737b4
commit fba3bbe47a
No known key found for this signature in database

View file

@ -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(<ModelInfoView {...DEFAULT_ADMIN_PROPS} />, { 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,