fix(Inputbar): Solve the problem that the initial state of assistant mcpServers is empty, and can not get enable mcp servers.

This commit is contained in:
BlBana 2025-04-03 17:04:02 +08:00 committed by 亢奋猫
parent aed9c04c20
commit 06c730aaf6

View File

@ -182,9 +182,9 @@ const Inputbar: FC<Props> = ({ assistant: _assistant, setActiveTopic, topic }) =
} }
if (isFunctionCallingModel(model)) { if (isFunctionCallingModel(model)) {
if (!isEmpty(assistant.mcpServers) && !isEmpty(activedMcpServers)) { if (!isEmpty(enabledMCPs) && !isEmpty(activedMcpServers)) {
userMessage.enabledMCPs = activedMcpServers.filter((server) => userMessage.enabledMCPs = activedMcpServers.filter((server) =>
assistant.mcpServers?.some((s) => s.id === server.id) enabledMCPs?.some((s) => s.id === server.id)
) )
} }
} }