[PR #4923] fix: edit tool error after undo #11175

Open
opened 2026-02-16 18:15:58 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/4923

State: open
Merged: No


Prevents unnecessary read/write cycles when editing files after undo / redo.
From edit -> error "modified externally" -> read -> edit (extra read and edit in context + extra time) to just edit.

  • Update FileTime for reverted files in revert() and unrevert() so the edit tool sees them as freshly read rather than externally modified

*Restoring the old read time would be more semantically correct but adds complexity without functional benefit.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/4923 **State:** open **Merged:** No --- Prevents unnecessary read/write cycles when editing files after undo / redo. From `edit -> error "modified externally" -> read -> edit` (extra read and edit in context + extra time) to just `edit`. - Update FileTime for reverted files in `revert()` and `unrevert()` so the edit tool sees them as freshly read rather than externally modified *Restoring the old read time would be more semantically correct but adds complexity without functional benefit.
yindo added the pull-request label 2026-02-16 18:15:58 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11175