diff --git a/src/core/Cline.ts b/src/core/Cline.ts index 79dac08c45..42bfd9db86 100644 --- a/src/core/Cline.ts +++ b/src/core/Cline.ts @@ -1113,14 +1113,9 @@ export class Cline { !block.partial, ) } catch (error) { - await this.say( - "error", - `Failed to apply changes to ${relPath}. The model's diff instructions could not be processed correctly. This usually happens when the search patterns don't match the file content exactly.`, - ) + await this.say("diff_error", relPath) pushToolResult( - formatResponse.toolError( - `Error writing file: ${JSON.stringify(serializeError(error))}`, - ), + formatResponse.toolError(`Error writing file: ${(error as Error)?.message}`), ) await this.diffViewProvider.revertChanges() await this.diffViewProvider.reset() diff --git a/src/shared/ExtensionMessage.ts b/src/shared/ExtensionMessage.ts index 3889f0e1c6..b3e58bc4a6 100644 --- a/src/shared/ExtensionMessage.ts +++ b/src/shared/ExtensionMessage.ts @@ -92,6 +92,7 @@ export type ClineSay = | "mcp_server_request_started" | "mcp_server_response" | "use_mcp_server" + | "diff_error" export interface ClineSayTool { tool: diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx index 6992fe486c..200b75a93d 100644 --- a/webview-ui/src/components/chat/ChatRow.tsx +++ b/webview-ui/src/components/chat/ChatRow.tsx @@ -794,6 +794,35 @@ export const ChatRowContent = ({
{message.text}
> ) + case "diff_error": + return ( + <> +