fix: handle toolnames without underscores (#7015)

Signed-off-by: Kyle Dunn <kdunn926@gmail.com>
This commit is contained in:
kdunn926
2026-02-06 07:58:05 -07:00
committed by GitHub
parent 4cfcd9b87b
commit 969ea53302
+2 -1
View File
@@ -109,7 +109,8 @@ export const getExtensionIcon = (extensionName: string): React.ComponentType<Too
* @returns Extracted tool name (e.g., "text_editor")
*/
export const extractToolName = (toolCallName: string): string => {
return toolCallName.substring(toolCallName.lastIndexOf('__') + 2);
const lastIndex = toolCallName.lastIndexOf('__');
return lastIndex === -1 ? toolCallName : toolCallName.substring(lastIndex + 2);
};
/**