Skip to content

fix(drive): delete command now moves to trash instead of permanent deletion#262

Merged
steipete merged 1 commit intoopenclaw:mainfrom
laihenyi:fix/drive-delete-trash
Feb 15, 2026
Merged

fix(drive): delete command now moves to trash instead of permanent deletion#262
steipete merged 1 commit intoopenclaw:mainfrom
laihenyi:fix/drive-delete-trash

Conversation

@laihenyi
Copy link
Copy Markdown
Contributor

Summary

  • Bug: drive delete called Files.Delete() (permanent, irreversible) despite the help text stating "moves to trash"
  • Fix: Default behavior now uses Files.Update() with Trashed: true to move files to trash (recoverable for 30 days)
  • New flag: --permanent for users who explicitly want irreversible deletion

Changes

  • DriveDeleteCmd gains a --permanent bool flag (default false)
  • Without --permanent: calls Files.Update with Trashed: true (safe, recoverable)
  • With --permanent: calls Files.Delete (irreversible, previous behavior)
  • Help text updated: "Move a file to trash (use --permanent to delete forever)"
  • JSON output distinguishes trashed: true vs deleted: true
  • Confirmation prompt reflects the action ("trash drive file" vs "permanently delete drive file")

Test plan

  • make builds successfully
  • All existing unit tests pass (go test ./internal/cmd/ -run TestDrive)
  • Manual verification: upload → delete → confirm file appears in trash (API still accessible)
  • Manual verification: upload → delete --permanent → confirm file is gone (404)

Fixes #261

🤖 Generated with Claude Code

…letion

`drive delete` was calling `Files.Delete()` which permanently destroys
files. This contradicts the help text ("moves to trash") and user
expectations. The fix changes the default behavior to use
`Files.Update()` with `Trashed: true`, which moves files to trash
(recoverable for 30 days).

A new `--permanent` flag is added for users who explicitly want
irreversible deletion.

Fixes openclaw#261

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@steipete steipete merged commit ee1dd3d into openclaw:main Feb 15, 2026
1 check passed
@laihenyi laihenyi deleted the fix/drive-delete-trash branch February 15, 2026 02:19
klodr pushed a commit to klodr/gogcli that referenced this pull request Apr 22, 2026
…letion (openclaw#262)

`drive delete` was calling `Files.Delete()` which permanently destroys
files. This contradicts the help text ("moves to trash") and user
expectations. The fix changes the default behavior to use
`Files.Update()` with `Trashed: true`, which moves files to trash
(recoverable for 30 days).

A new `--permanent` flag is added for users who explicitly want
irreversible deletion.

Fixes openclaw#261

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: drive delete permanently deletes files instead of moving to trash

2 participants