Agent Panel: File is wrongly deleted on Reject All
Summary
File is wrongly deleted on Reject All.
Description
Steps to trigger the problem:
- On an uncommitted file with edits you have accepted or where you may have written code yourself
- Click "Reject all"
- Your file is deleted and your day is ruined
Actual Behavior: The file should not be deleted if the user has written any lines in it before. Expected Behavior: The file is deleted if changes are rejected.
Zed Version and System Specs
Zed: v0.186.5 (Zed Preview) OS: Linux Wayland nixos 25.05 Memory: 62.6 GiB Architecture: x86_64 GPU: NVIDIA GeForce RTX 3060 || NVIDIA || 570.133.07
This is still an issue as of Zed 0.186.9
I've seen this happen where the agent deletes the file and rewrites it from scratch, but only introduces a few changes (I'm not sure if it's deleting the contents of the file or the file itself). The resulting diff is small, but rejecting can delete the whole file.
I think your issue is different. In my case, a file may be deleted if I click "Reject All".
I'm also clicking "Reject All"
Hey all, sorry for this. I'm not able to repro on macOS, but I'll see if one of the Linux folks can. This is def something we will work on fixing.
This happened to me after rejecting a hunk. The whole diff for the file is rejected (not only the hunk) and if it is a new file it's removed completely. I'm on macOS by the way.
Sorry about this issue! The good news is that the fix should become available in the upcoming release.
This is not solved! Please re open this issue.
@mwitteveen, I can no longer reproduce this issue. If you do, could you please open another ticket with your system's details and steps to reproduce?
Difficult to reproduce, it is very unstable. Sometimes after an hour into prompting I reject one edit and a whole file is gone. What do you want me to send you at that moment?