apply_patch changes have no Undo
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
Research direction
Start with src/main/tools/apply_patch.ts and trace how write_file and edit_file return undo records, then follow the existing edit:undo handling. The proposal calls for backups and post-change hashes per changed file, with a single undo refused if any file has changed since; deleted and moved files also need records. Done means multi-file patches can be undone together while preserving that safety check.
Written by the indexing model from the issue text.
Description
Suggestion from the 2026-10-07 code review (not a bug).
write_file and edit_file return an undo record, so their cards offer Undo. apply_patch (src/main/tools/apply_patch.ts) returns none, so a multi-file patch can't be undone from the transcript, even though it is the tool the model is told to use for larger changes.
Proposal
Return one backup per changed file (before bytes plus the hash after the change) and let edit:undo restore them together. Refuse the undo when any file no longer matches, as single-file undo already does. Deleted and moved files need their own records.
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 2
- Avg merge
- 5h 52m
- Merged PRs (30d)
- 18
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PierrunoYT/patch
-
enhancement priority: low security severity: low
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
PierrunoYT/patch#208 ·
Maintainers usually reply within 1 day
-
enhancement platform: windows priority: low severity: low
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PierrunoYT/patch#198 ·
Maintainers usually reply within 1 day
-
bug priority: low severity: low
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PierrunoYT/patch#190 ·
Maintainers usually reply within 1 day
-
Unbounded waits: revokeProjectGrant has no timeout, and timed-out browser waiters are never removedOpenbug priority: low severity: low
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PierrunoYT/patch#188 ·
Maintainers usually reply within 1 day
-
bug priority: medium severity: low
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
PierrunoYT/patch#179 ·
Maintainers usually reply within 1 day
All issues in PierrunoYT/patch
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
farbenmeer/tapi#531 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
naver/egjs-flicking#971 ·
-
Renderer treats a sub-pixel width difference as a resize, which cancels the `motion()` entranceOpen
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Tenant
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
MTES-MCT/Dossier-Facile-Frontend#2061 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
backnotprop/plannotator#1784 ·
Maintainers usually reply within 1 day