Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix(ui): send empty vector_stores when the last team vector store is removed (#40144)

devin-ai-integration[bot]c949843157f8
diff --git a/ui/litellm-dashboard/src/components/team/TeamInfo.test.tsx b/ui/litellm-dashboard/src/components/team/TeamInfo.test.tsx
index 041ba4b548d..b286c8c1303 100644
--- a/ui/litellm-dashboard/src/components/team/TeamInfo.test.tsx
+++ b/ui/litellm-dashboard/src/components/team/TeamInfo.test.tsx
@@ -2052,6 +2052,19 @@ describe("TeamInfoView - the exact bytes the update call sends", () => {
expect(objectPermission.agent_access_groups).toStrictEqual([]);
});
+ it("sends an empty vector_stores array after the last vector store chip is removed", async () => {
+ const user = userEvent.setup({ delay: null });
+ await openEditor(user);
+
+ await user.click(within(screen.getByLabelText("vs-1")).getByRole("button"));
+ expect(screen.queryByLabelText("vs-1")).not.toBeInTheDocument();
+
+ const payload = await save(user);
+
+ const objectPermission = wireBody(payload).object_permission as Record<string, unknown>;
+ expect(objectPermission.vector_stores).toStrictEqual([]);
+ });
+
it("resends every stored value once both sections are opened", async () => {
const user = userEvent.setup({ delay: null });
await openEditor(user);
diff --git a/ui/litellm-dashboard/src/components/team/TeamInfo.tsx b/ui/litellm-dashboard/src/components/team/TeamInfo.tsx
index efd69a79fc0..4947cec1441 100644
--- a/ui/litellm-dashboard/src/components/team/TeamInfo.tsx
+++ b/ui/litellm-dashboard/src/components/team/TeamInfo.tsx
@@ -1039,7 +1039,7 @@ const TeamInfoView: React.FC<TeamInfoProps> = ({
delete values.agents_and_groups;
// Handle vector stores permissions
- if (values.vector_stores && values.vector_stores.length > 0) {
+ if (values.vector_stores) {
updateData.object_permission.vector_stores = values.vector_stores;
}