From 5900629e6aed2be6a54c53f9e566cd6faef67d20 Mon Sep 17 00:00:00 2001 From: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com> Date: Wed, 18 Dec 2024 14:58:37 -0800 Subject: [PATCH 1/2] Fix error message for when diff fails --- src/core/Cline.ts | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/core/Cline.ts b/src/core/Cline.ts index ccf2cffc2..79dac08c4 100644 --- a/src/core/Cline.ts +++ b/src/core/Cline.ts @@ -1106,11 +1106,26 @@ export class Cline { // Construct newContent from diff let newContent: string if (diff) { - newContent = await constructNewFileContent( - diff, - this.diffViewProvider.originalContent || "", - !block.partial, - ) + try { + newContent = await constructNewFileContent( + diff, + this.diffViewProvider.originalContent || "", + !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.`, + ) + pushToolResult( + formatResponse.toolError( + `Error writing file: ${JSON.stringify(serializeError(error))}`, + ), + ) + await this.diffViewProvider.revertChanges() + await this.diffViewProvider.reset() + break + } } else if (content) { newContent = content From b7b5d28bb18f1b8cc8e32a306d00f00976b3eeeb Mon Sep 17 00:00:00 2001 From: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com> Date: Wed, 18 Dec 2024 14:59:14 -0800 Subject: [PATCH 2/2] Prepare for release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 57c2f13dc..30e097d80 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "claude-dev", "displayName": "Cline (prev. Claude Dev)", "description": "Autonomous coding agent right in your IDE, capable of creating/editing files, running commands, using the browser, and more with your permission every step of the way.", - "version": "3.0.0", + "version": "3.0.1", "icon": "assets/icons/icon.png", "galleryBanner": { "color": "#617A91",