From 893f0d7e54629e5aade1c13a99c4d8e33a948458 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Mon, 24 Nov 2025 14:29:58 +0000 Subject: [PATCH] fix: remove incorrect removeClosingTag usage on file paths in WriteToFileTool The removeClosingTag function was incorrectly being called on file paths in the execute method. This function is meant to clean up partial XML tags during streaming, not process actual parameter values. This was causing file path corruption, particularly for paths after the first file creation. Fixes #9533 --- src/core/tools/WriteToFileTool.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/tools/WriteToFileTool.ts b/src/core/tools/WriteToFileTool.ts index 4c355beb07..fff53a3fdd 100644 --- a/src/core/tools/WriteToFileTool.ts +++ b/src/core/tools/WriteToFileTool.ts @@ -91,12 +91,12 @@ export class WriteToFileTool extends BaseTool<"write_to_file"> { newContent = unescapeHtmlEntities(newContent) } - const fullPath = relPath ? path.resolve(task.cwd, removeClosingTag("path", relPath)) : "" + const fullPath = relPath ? path.resolve(task.cwd, relPath) : "" const isOutsideWorkspace = isPathOutsideWorkspace(fullPath) const sharedMessageProps: ClineSayTool = { tool: fileExists ? "editedExistingFile" : "newFileCreated", - path: getReadablePath(task.cwd, removeClosingTag("path", relPath)), + path: getReadablePath(task.cwd, relPath), content: newContent, isOutsideWorkspace, isProtected: isWriteProtected,