[bug] Edit tool overwrites unrelated accepted edits when applying multiple changes sequentially #2595

Closed
opened 2026-02-16 17:36:22 -05:00 by yindo · 1 comment
Owner

Originally created by @sr-tream on GitHub (Nov 4, 2025).

Description

When using the edit tool, the model often suggests multiple changes for the same file, each targeting different, non-conflicting sections (e.g., via parallel_tool). If I accept the first edit, it applies as expected. On accepting the second edit, it undoes the first and applies only its own change; the same happens for a third edit, which undoes the second. As a result, only the last accepted edit is present in the file, and previous, unrelated accepted changes are lost.

Expected: Accepting edits in sequence should result in all non-conflicting changes being incorporated into the file, not overwritten by subsequent accepted edits.

OpenCode version

1.0.23

Steps to reproduce

  1. Request multiple (e.g., 3) non-conflicting edits for one file using the model's parallel_tool.
  2. Accept the first change. It is applied as expected.
  3. Accept the second change. The first change is overwritten (lost), and only the second change remains applied.
  4. Accept the third change. The second change is now lost, and only the third is present -- instead of combining all non-conflicting changes.

Screenshot and/or share link

https://opencode.ai/s/GBhyYK1U

Operating System

ArchLinux

Terminal

konsole

Originally created by @sr-tream on GitHub (Nov 4, 2025). ### Description When using the edit tool, the model often suggests multiple changes for the same file, each targeting different, non-conflicting sections (e.g., via parallel_tool). If I accept the first edit, it applies as expected. On accepting the second edit, it undoes the first and applies only its own change; the same happens for a third edit, which undoes the second. As a result, only the last accepted edit is present in the file, and previous, unrelated accepted changes are lost. Expected: Accepting edits in sequence should result in all non-conflicting changes being incorporated into the file, not overwritten by subsequent accepted edits. ### OpenCode version 1.0.23 ### Steps to reproduce 1. Request multiple (e.g., 3) non-conflicting edits for one file using the model's parallel_tool. 2. Accept the first change. It is applied as expected. 3. Accept the second change. The first change is *overwritten* (lost), and only the second change remains applied. 4. Accept the third change. The second change is now lost, and only the third is present -- instead of combining all non-conflicting changes. ### Screenshot and/or share link https://opencode.ai/s/GBhyYK1U ### Operating System ArchLinux ### Terminal konsole
yindo added the opentuibug labels 2026-02-16 17:36:22 -05:00
yindo closed this issue 2026-02-16 17:36:22 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 4, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #3856: Describes the same race condition where the last change overrides all previous changes when accepting multiple edits on the same file sequentially
  • #2882: Related issue about parallel edit tool calls on same file causing errors (though this is about the error prevention, not the overwrite behavior)

The core issue described in #3856 appears to be identical - when multiple changes are accepted quickly on the same file, only the last change is applied and previous changes are lost.

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Nov 4, 2025): This issue might be a duplicate of existing issues. Please check: - #3856: Describes the same race condition where the last change overrides all previous changes when accepting multiple edits on the same file sequentially - #2882: Related issue about parallel edit tool calls on same file causing errors (though this is about the error prevention, not the overwrite behavior) The core issue described in #3856 appears to be identical - when multiple changes are accepted quickly on the same file, only the last change is applied and previous changes are lost. Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2595