From 06c730aaf64831ead7de8b408b4a302baceb12d3 Mon Sep 17 00:00:00 2001 From: BlBana Date: Thu, 3 Apr 2025 17:04:02 +0800 Subject: [PATCH] fix(Inputbar): Solve the problem that the initial state of assistant mcpServers is empty, and can not get enable mcp servers. --- src/renderer/src/pages/home/Inputbar/Inputbar.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/pages/home/Inputbar/Inputbar.tsx b/src/renderer/src/pages/home/Inputbar/Inputbar.tsx index 536a04f2..5b0e0151 100644 --- a/src/renderer/src/pages/home/Inputbar/Inputbar.tsx +++ b/src/renderer/src/pages/home/Inputbar/Inputbar.tsx @@ -182,9 +182,9 @@ const Inputbar: FC = ({ assistant: _assistant, setActiveTopic, topic }) = } if (isFunctionCallingModel(model)) { - if (!isEmpty(assistant.mcpServers) && !isEmpty(activedMcpServers)) { + if (!isEmpty(enabledMCPs) && !isEmpty(activedMcpServers)) { userMessage.enabledMCPs = activedMcpServers.filter((server) => - assistant.mcpServers?.some((s) => s.id === server.id) + enabledMCPs?.some((s) => s.id === server.id) ) } }