Repository navigation
Commit 7b6835f
committed
fix(write_to_file): run diff cleanup when handleError rejects; tighten abort-listener assertion
Address the remaining CodeRabbit findings:
- WriteToFileTool.execute(): the catch block awaited handleError before
restoring the diff document; the production handleError awaits Task.say(),
which rejects when the task is aborted, so a rejected handleError skipped
the revert/reset cleanup and could leave unapproved streamed content
dirty. The cleanup now runs in a finally around handleError (the
!writeApproved condition and revert-before-reset ordering are preserved)
and the handleError rejection still propagates.
- writeToFileTool.spec.ts: the parse-failure test now captures the
registered TaskAborted listener and asserts off() receives that exact
reference instead of expect.any(Function).
Adds a regression test proving the cleanup runs when handleError rejects.1 parent a704b15 commit 7b6835f
2 files changed
Lines changed: 52 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
396 | 404 | | |
397 | | - | |
398 | 405 | | |
399 | 406 | | |
400 | 407 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
725 | 725 | | |
726 | 726 | | |
727 | 727 | | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
728 | 737 | | |
729 | 738 | | |
730 | 739 | | |
| |||
749 | 758 | | |
750 | 759 | | |
751 | 760 | | |
752 | | - | |
| 761 | + | |
| 762 | + | |
753 | 763 | | |
754 | | - | |
| 764 | + | |
| 765 | + | |
755 | 766 | | |
756 | 767 | | |
757 | 768 | | |
| |||
1364 | 1375 | | |
1365 | 1376 | | |
1366 | 1377 | | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
1367 | 1403 | | |
1368 | 1404 | | |
1369 | 1405 | | |
| |||
0 commit comments