Commit 63a5f66
committed
fix: treat files with only whitespace as empty in read_file tool
- Added trim() check to detect files containing only whitespace characters
- Files with only spaces, tabs, or newlines now show "File is empty" notice
- Original file content is preserved without modification
- Added test case to verify whitespace-only files are treated as empty
Fixes #57891 parent e28fad1 commit 63a5f66
File tree
2 files changed
+21
-2
lines changed- src/core/tools
- __tests__
2 files changed
+21
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
481 | 481 | | |
482 | 482 | | |
483 | 483 | | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
484 | 499 | | |
485 | 500 | | |
486 | 501 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
519 | 519 | | |
520 | 520 | | |
521 | 521 | | |
522 | | - | |
523 | 522 | | |
524 | | - | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
525 | 529 | | |
526 | 530 | | |
527 | 531 | | |
| |||
0 commit comments