From 4ba9219e1dc63c8043cf8c4db6d039d86f7cdc96 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Wed, 8 Apr 2026 22:15:38 -0700 Subject: [PATCH] fix: exclude defaults from hasValues check to avoid overwriting router settings enable_tag_filtering: false (the default) passed the hasValues guard, causing every team save to send router_settings even for teams that never had them configured. This could silently overwrite backend-set values. Now exclude false and empty arrays from the check. --- ui/litellm-dashboard/src/components/team/TeamInfo.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ui/litellm-dashboard/src/components/team/TeamInfo.tsx b/ui/litellm-dashboard/src/components/team/TeamInfo.tsx index d0aa2ebf26f..96cde701f7d 100644 --- a/ui/litellm-dashboard/src/components/team/TeamInfo.tsx +++ b/ui/litellm-dashboard/src/components/team/TeamInfo.tsx @@ -591,11 +591,18 @@ const TeamInfoView: React.FC = ({ updateData.access_group_ids = values.access_group_ids; } - // Handle router_settings - read fresh values from DOM at save time + // Handle router_settings - read fresh values from DOM at save time. + // Only include if the user actually configured something meaningful + // (exclude defaults like enable_tag_filtering: false and empty arrays). const currentRouterSettings = routerSettingsRef.current?.getValue(); if (currentRouterSettings?.router_settings) { const hasValues = Object.values(currentRouterSettings.router_settings).some( - (value) => value !== null && value !== undefined && value !== "", + (value) => + value !== null && + value !== undefined && + value !== "" && + value !== false && + !(Array.isArray(value) && value.length === 0), ); if (hasValues) { updateData.router_settings = currentRouterSettings.router_settings;