zed icon indicating copy to clipboard operation
zed copied to clipboard

Agent Panel: File is wrongly deleted on Reject All

Open poly2it opened this issue 9 months ago • 5 comments

Summary

File is wrongly deleted on Reject All.

Description

Steps to trigger the problem:

  1. On an uncommitted file with edits you have accepted or where you may have written code yourself
  2. Click "Reject all"
  3. 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

poly2it avatar May 11 '25 22:05 poly2it

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.

wolfadex avatar May 15 '25 22:05 wolfadex

I think your issue is different. In my case, a file may be deleted if I click "Reject All".

poly2it avatar May 16 '25 15:05 poly2it

I'm also clicking "Reject All"

wolfadex avatar May 19 '25 21:05 wolfadex

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.

JosephTLyons avatar May 20 '25 14:05 JosephTLyons

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.

jorgejhms avatar May 26 '25 21:05 jorgejhms

Sorry about this issue! The good news is that the fix should become available in the upcoming release.

osyvokon avatar May 28 '25 18:05 osyvokon

This is not solved! Please re open this issue.

mwitteveen avatar Jun 09 '25 15:06 mwitteveen

@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?

osyvokon avatar Jun 09 '25 17:06 osyvokon

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?

mwitteveen avatar Jun 10 '25 10:06 mwitteveen