Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions ui/desktop/src/components/ToolCallWithResponse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,14 @@ const notificationToProgress = (notification: NotificationEvent): Progress => {
return message.params as Progress;
};

// Helper function to extract toolcall name
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can drop this comment I think

const getToolName = (toolCallName: string): string => {
const lastIndex = toolCallName.lastIndexOf('__');
if (lastIndex === -1) return toolCallName;

return toolCallName.substring(lastIndex + 2);
}

// Helper function to extract extension name for tooltip
const getExtensionTooltip = (toolCallName: string): string | null => {
const lastIndex = toolCallName.lastIndexOf('__');
Expand Down Expand Up @@ -315,7 +323,7 @@ function ToolCallView({
// Function to create a descriptive representation of what the tool is doing
const getToolDescription = (): string | null => {
const args = toolCall.arguments as Record<string, ToolCallArgumentValue>;
const toolName = toolCall.name.substring(toolCall.name.lastIndexOf('__') + 2);
const toolName = getToolName(toolCall.name);

const getStringValue = (value: ToolCallArgumentValue): string => {
return typeof value === 'string' ? value : JSON.stringify(value);
Expand Down Expand Up @@ -481,7 +489,7 @@ function ToolCallView({
return description;
}
// Fallback tool name formatting
return snakeToTitleCase(toolCall.name.substring(toolCall.name.lastIndexOf('__') + 2));
return snakeToTitleCase(getToolName(toolCall.name));
};
// Map LoadingStatus to ToolCallStatus
const getToolCallStatus = (loadingStatus: LoadingStatus): ToolCallStatus => {
Expand Down