Skip to content

Commit 1f322e0

Browse files
daniel-lxsroomote
authored andcommitted
fix: suppress tool result XML when file not found error is emitted
- Set xmlContent to empty string for ENOENT errors to prevent duplicate error display - The file_not_found_error message is already emitted separately and displayed with proper styling - This prevents the raw 'Error reading file...' text from appearing in the UI
1 parent e270192 commit 1f322e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/tools/readFileTool.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ export async function readFileTool(
626626
updateFileResult(relPath, {
627627
status: "error",
628628
error: "File not found",
629-
xmlContent: `<file><path>${relPath}</path><error>File not found: The requested file does not exist in the current workspace.</error></file>`,
629+
xmlContent: "", // Empty to prevent duplicate error display
630630
})
631631
} else {
632632
updateFileResult(relPath, {
@@ -731,7 +731,7 @@ export async function readFileTool(
731731
updateFileResult(relPath, {
732732
status: "error",
733733
error: "File not found",
734-
xmlContent: `<file><path>${relPath}</path><error>File not found: The requested file does not exist in the current workspace.</error></file>`,
734+
xmlContent: "", // Empty to prevent duplicate error display
735735
})
736736
}
737737
} else {

0 commit comments

Comments
 (0)