Restore file to original content when rejecting file recreated by agent (#29264)

Release Notes:

- Fixed a bug that could sometimes cause a file to be deleted when
rejecting an agent change.
This commit is contained in:
Antonio Scandurra
2025-04-23 09:42:43 +00:00
committed by GitHub
parent 5e31d86f1f
commit 55ea481707
11 changed files with 77 additions and 63 deletions
+1 -1
View File
@@ -182,7 +182,7 @@ impl Tool for EditFileTool {
let snapshot = cx.update(|cx| {
action_log.update(cx, |log, cx| {
log.buffer_read(buffer.clone(), cx)
log.track_buffer(buffer.clone(), cx)
});
let snapshot = buffer.update(cx, |buffer, cx| {
buffer.finalize_last_transaction();