[PR #4088] Fix parallel edit FileTime behavior (#2882) #10868

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

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

State: closed
Merged: No


Summary

  • Allow parallel edit/write/patch calls within the same session without tripping the "Please read the file again before modifying it" guard.
  • Track tool-driven writes via FileTime so external modifications after a session read still trigger the safety error.
  • Add regression tests for overlapping edits, missing-read behavior, and external-change detection for the edit tool.

Details

Refines FileTime to maintain best-effort read timestamps plus last-writer metadata per file. Edit, write, and patch tools mark their own writes, and FileTime.assert uses this to:

  • Permit same-session overlapping operations that write based on the same snapshot.
  • Continue to throw when the file is modified by another session or process after the last read.

This directly addresses #2882 by preventing valid parallel edits from being blocked while preserving protection against out-of-band changes.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/4088 **State:** closed **Merged:** No --- ## Summary - Allow parallel edit/write/patch calls within the same session without tripping the "Please read the file again before modifying it" guard. - Track tool-driven writes via FileTime so external modifications after a session read still trigger the safety error. - Add regression tests for overlapping edits, missing-read behavior, and external-change detection for the edit tool. ## Details Refines FileTime to maintain best-effort read timestamps plus last-writer metadata per file. Edit, write, and patch tools mark their own writes, and FileTime.assert uses this to: - Permit same-session overlapping operations that write based on the same snapshot. - Continue to throw when the file is modified by another session or process after the last read. This directly addresses #2882 by preventing valid parallel edits from being blocked while preserving protection against out-of-band changes.
yindo added the pull-request label 2026-02-16 18:15:37 -05:00
yindo closed this issue 2026-02-16 18:15:37 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#10868