mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
fix(write-to-file): strip XML parameter spillover from content before writing files
This commit is contained in:
parent
c0717407c0
commit
0a63a54352
1 changed files with 4 additions and 0 deletions
|
|
@ -86,6 +86,10 @@ export async function writeToFileTool(
|
|||
if (!cline.api.getModel().id.includes("claude")) {
|
||||
newContent = unescapeHtmlEntities(newContent)
|
||||
}
|
||||
// Strip accidental XML-like parameter spillover that can appear at the end of content
|
||||
// e.g., "</parameter>\n<parameter name=\"line_count\">1"
|
||||
newContent = newContent.replace(/\n<\/parameter>\s*\n<parameter name="line_count">[\s\S]*$/i, "")
|
||||
newContent = newContent.replace(/\n<\/parameter>\s*$/i, "")
|
||||
|
||||
// Determine if the path is outside the workspace
|
||||
const fullPath = relPath ? path.resolve(cline.cwd, removeClosingTag("path", relPath)) : ""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue