From fb017f995243a735a852c7323746a34cd2df8341 Mon Sep 17 00:00:00 2001 From: Xin Wang Date: Mon, 2 Mar 2026 12:40:00 +0800 Subject: [PATCH] Refactor selectedToolSchemas logic in DebugDrawer to simplify tool ID normalization. Removed redundant inclusion of DEBUG_CLIENT_TOOLS, enhancing code clarity and performance. --- web/pages/Assistants.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/web/pages/Assistants.tsx b/web/pages/Assistants.tsx index 266bbe6..a58fd84 100644 --- a/web/pages/Assistants.tsx +++ b/web/pages/Assistants.tsx @@ -2449,9 +2449,7 @@ export const DebugDrawer: React.FC<{ const isClientToolEnabled = (toolId: string) => clientToolEnabledMap[normalizeToolId(toolId)] !== false; const isClientToolEnabledLive = (toolId: string) => clientToolEnabledMapRef.current[normalizeToolId(toolId)] !== false; const selectedToolSchemas = useMemo(() => { - const ids = Array.from( - new Set([...(assistant.tools || []).map((id) => normalizeToolId(id)), ...DEBUG_CLIENT_TOOLS.map((item) => item.id)]) - ); + const ids = Array.from(new Set((assistant.tools || []).map((id) => normalizeToolId(id)))); const byId = new Map(tools.map((t) => [normalizeToolId(t.id), { ...t, id: normalizeToolId(t.id) }])); return ids.map((id) => { const item = byId.get(id);