Add separate confirmation setting for file deletions
Release Notes:
-
Added a new setting
confirm_file_deletionsthat allows users to require explicit confirmation before the agent deletes files. - UI: Introduced a toggle switch in the agent configuration panel for "Always ask for confirmation before deleting files?".
- Improved safety: File deletions now require explicit user confirmation when the new setting is enabled, regardless of other permissions.
- Backend: Extended settings structs and update methods to support the new option.
-
Tool Logic: Modified the
delete_pathtool to check theconfirm_file_deletionssetting and request confirmation as needed.
Image
This is a very odd change.
#30896 mentions file finder, from what it looks like, this PR changes the assistant for some reason.
Besides, extra settings do not look right at all: we already have
"skip_prompt": falsefor thathttps://github.com/zed-industries/zed/blob/0079c99c2ccfdac54b879e5efeec10344f3bee03/assets/keymaps/default-macos.json#L824
Thank you for reviewing this PR! I wanted to clarify that I mistakenly associated this change with issue 30896. I initially thought the issue was about files being deleted by AI without confirmation, and I implemented a confirmation prompt before file deletion as a result. However, after re-reading the issue, I realized it was specifically about confirming file deletion from the cmd-delete, not about confirmation prompts.
Although it might be a usefull feature ( option to toggle confirmations before deletions, which is false by default )
Apologies for the confusion. Let me know if you’d like me to adjust the PR to better fit the actual issue, or if this feature should be tracked separately.
Let me know if you’d like me to adjust the PR to better fit the actual issue, or if this feature should be tracked separately.
No good clue about the AI features, sorry. Presumably, the discussion is what it should start with first?
Let me know if you’d like me to adjust the PR to better fit the actual issue, or if this feature should be tracked separately.
No good clue about the AI features, sorry. Presumably, the discussion is what it should start with first?
I think this feature is useful for using the AI assistant. Should I open a separate request for it maybe?
@cla-bot check
The cla-bot has been summoned, and re-checked this pull request!
Currently, there's no way to specifically mark the deletion as require approval without marking all other actions to require approval.
This just provides an option to the user, to allow agent to delete files without asking, or always ask before deleting.
If this might be usefull and any changes are needed, let me know please. @notpeter
Any updates ;-;?
@CLoaKY233 Thanks for the idea!
We talked about it, and since there are many ways for the agent to cause data loss other than deleting files (e.g. removing the entire contents of the file but not deleting it), and we already have ways to recover from those (e.g. restore from checkpoint), we don't think there should be a separate setting for this.