fix: handle toolnames without underscores (#7015)
Signed-off-by: Kyle Dunn <kdunn926@gmail.com>
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user