From 7c23282da70168291bef2d691951005df639cc63 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Sat, 6 Jun 2026 22:12:09 +0000 Subject: [PATCH] fix: reset tool name mappings in handleCancel and handleCreate Addresses Greptile feedback: toolNameToDisplayName and toolNameToDescription were not being reset when the modal was cancelled or after successful creation, which could leak stale data from a duplicated server into the next fresh create modal. https://claude.ai/code/session_01Wx49QQnsCngnJ7hsfaC1yC --- ui/litellm-dashboard/eslint-suppressions.json | 5 ----- .../src/components/mcp_tools/create_mcp_server.tsx | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ui/litellm-dashboard/eslint-suppressions.json b/ui/litellm-dashboard/eslint-suppressions.json index a5a13e23e5d..e223c69f69a 100644 --- a/ui/litellm-dashboard/eslint-suppressions.json +++ b/ui/litellm-dashboard/eslint-suppressions.json @@ -1517,11 +1517,6 @@ "count": 1 } }, - "src/components/organisms/RegenerateKeyModal.tsx": { - "react-hooks/set-state-in-effect": { - "count": 1 - } - }, "src/components/organisms/create_key_button.test.tsx": { "@typescript-eslint/no-require-imports": { "count": 2 diff --git a/ui/litellm-dashboard/src/components/mcp_tools/create_mcp_server.tsx b/ui/litellm-dashboard/src/components/mcp_tools/create_mcp_server.tsx index ca05197cb7c..b5f1cd593ce 100644 --- a/ui/litellm-dashboard/src/components/mcp_tools/create_mcp_server.tsx +++ b/ui/litellm-dashboard/src/components/mcp_tools/create_mcp_server.tsx @@ -569,6 +569,8 @@ const CreateMCPServer: React.FC = ({ setHasToolAllowlistInteraction(false); setAliasManuallyEdited(false); setLogoUrl(undefined); + setToolNameToDisplayName({}); + setToolNameToDescription({}); setModalVisible(false); onCreateSuccess(response); } @@ -591,6 +593,8 @@ const CreateMCPServer: React.FC = ({ setHasToolAllowlistInteraction(false); setAliasManuallyEdited(false); setLogoUrl(undefined); + setToolNameToDisplayName({}); + setToolNameToDescription({}); setModalVisible(false); };