Skip to content

Commit c7c0996

Browse files
committed
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.
1 parent f173c9c commit c7c0996

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/tools/WriteToFileTool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ export class WriteToFileTool extends BaseTool<"write_to_file"> {
290290
const relPath: string | undefined = block.params.path
291291
let newContent: string | undefined = block.params.content
292292

293-
if (!relPath) {
293+
if (!relPath || newContent === undefined) {
294294
return
295295
}
296296

0 commit comments

Comments
 (0)