Skip to content

Commit bf255fb

Browse files
committed
feat: update XML parsing logic to handle multi-file format without toolUseId
1 parent 4476607 commit bf255fb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/core/tools/multiApplyDiffTool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export async function applyDiffTool(
109109
// Parse file entries from XML (new way)
110110
try {
111111
let files = [] as any[]
112-
if (argsXmlTag) {
112+
if (argsXmlTag && !block.toolUseId) {
113113
// IMPORTANT: We use parseXmlForDiff here instead of parseXml to prevent HTML entity decoding
114114
// This ensures exact character matching when comparing parsed content against original file content
115115
// Without this, special characters like & would be decoded to & causing diff mismatches

src/core/tools/readFileTool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export async function readFileTool(
129129
// Parse file entries from XML (new multi-file format)
130130
try {
131131
let files: any[] = []
132-
if (argsXmlTag) {
132+
if (argsXmlTag && !block.toolUseId) {
133133
const parsed = parseXml(argsXmlTag) as any
134134
files = Array.isArray(parsed.file) ? parsed.file : [parsed.file].filter(Boolean)
135135
} else {

0 commit comments

Comments
 (0)