diff --git a/src/extension.ts b/src/extension.ts index 9530e98..a82033b 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -580,7 +580,7 @@ class ClaudeChatProvider { const toolName = lastToolUse?.data?.toolName; // Don't send tool result for Read and Edit tools unless there's an error - if ((toolName === 'Read' || toolName === 'Edit') && !isError) { + if ((toolName === 'Read' || toolName === 'Edit' || toolName === 'TodoWrite') && !isError) { // Still send to UI to hide loading state, but mark it as hidden this._sendAndSaveMessage({ type: 'toolResult', diff --git a/src/ui.ts b/src/ui.ts index 6beec62..d2dfdfa 100644 --- a/src/ui.ts +++ b/src/ui.ts @@ -611,7 +611,12 @@ const html = ` const toolInfoElement = document.createElement('div'); toolInfoElement.className = 'tool-info'; - toolInfoElement.textContent = data.toolInfo.replace('🔧 Executing: ', ''); + let toolName = data.toolInfo.replace('🔧 Executing: ', ''); + // Replace TodoWrite with more user-friendly name + if (toolName === 'TodoWrite') { + toolName = 'Update Todos'; + } + toolInfoElement.textContent = toolName; headerDiv.appendChild(iconDiv); headerDiv.appendChild(toolInfoElement); @@ -723,10 +728,19 @@ const html = ` function addToolResultMessage(data) { // For Read and Edit tools with hidden flag, just hide loading state and show completion message - if (data.hidden && (data.toolName === 'Read' || data.toolName === 'Edit') && !data.isError) { + if (data.hidden && (data.toolName === 'Read' || data.toolName === 'Edit' || data.toolName === 'TodoWrite') && !data.isError) { // Show completion message const toolName = data.toolName; - const completionText = toolName === 'Read' ? '✅ Read completed' : '✅ Edit completed'; + let completionText; + if (toolName === 'Read') { + completionText = '✅ Read completed'; + } else if (toolName === 'Edit') { + completionText = '✅ Edit completed'; + } else if (toolName === 'TodoWrite') { + return + } else { + completionText = '✅ ' + toolName + ' completed'; + } addMessage(completionText, 'system'); return; // Don't show the result message } @@ -1512,14 +1526,7 @@ const html = ` break; case 'toolResult': - if (message.data.content.trim()) { - // Don't show result for TodoWrite tool (it's redundant with the tool execution display) - const isTodoWrite = message.data.content.includes('Todos have been modified successfully. Ensure that you continue to use the todo list to track your progress. Please proceed with the current tasks if applicable') - - if (!isTodoWrite) { addToolResultMessage(message.data); - } - } break; case 'thinking':