From c7c09966cf2e6c45d94f489bce7c681d0d604754 Mon Sep 17 00:00:00 2001 From: daniel-lxs Date: Wed, 26 Nov 2025 10:51:36 -0500 Subject: [PATCH] fix: restore content undefined check in WriteToFileTool.handlePartial() Fixes error 'Error handling partial write_to_file' when native tools are not enabled. PR #9542 unintentionally removed the newContent === undefined check from handlePartial(), causing errors during XML protocol streaming when content arrives incrementally. This restores the early return when content is undefined, preventing the method from attempting file operations with incomplete data. The existing test at line 357-361 validates this behavior. --- src/core/tools/WriteToFileTool.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/tools/WriteToFileTool.ts b/src/core/tools/WriteToFileTool.ts index 310d26b117d..116017d5207 100644 --- a/src/core/tools/WriteToFileTool.ts +++ b/src/core/tools/WriteToFileTool.ts @@ -290,7 +290,7 @@ export class WriteToFileTool extends BaseTool<"write_to_file"> { const relPath: string | undefined = block.params.path let newContent: string | undefined = block.params.content - if (!relPath) { + if (!relPath || newContent === undefined) { return }