Repository navigation
Commit 6b7d45e
committed
fix(apply-diff): retire the abandoned read's observation after a stale rejection
open() re-reads the file and records that newer version as the save baseline
(src/integrations/editor/DiffViewProvider.ts:149-157). When apply_diff then rejects the
diff as stale, the rollback retires the editor buffer but the observation stayed
current, so a later write_to_file - focus-disruption save enabled - could publish on a
read this tool had abandoned. ObservationRegistry gains a per-path forget so the
stale flow drops exactly that path; clear() would have stripped observations that
belong to other files.
Answers review root PRRT_kwDOSK-bwM61KUm3 (src/core/tools/ApplyDiffTool.ts:238).
Controls and their exits at the tree this replaces (b49fa5d):
- src/core/task/__tests__/observationRegistry.spec.ts
"forget drops one path and leaves every other path observed" - exit 1, TypeError:
"reg.forget is not a function"; exit 0 here (14 passed).
- src/core/tools/__tests__/applyDiffTool.guardedWrite.spec.ts
"retires the diff view observation for this path when it rejects a stale diff" -
exit 1, "expected true to be false // Object.is equality"; exit 0 here (12 passed).
applyDiffTool.failureReporting.spec.ts also re-run green (35 passed).1 parent b49fa5d commit 6b7d45e
4 files changed
Lines changed: 78 additions & 0 deletions
File tree
- src/core
- task
- __tests__
- tools
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
39 | 52 | | |
40 | 53 | | |
41 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
59 | 71 | | |
60 | 72 | | |
61 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
247 | 253 | | |
248 | 254 | | |
249 | 255 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
444 | 491 | | |
0 commit comments