Description
A single apply_patch call with multiple *** Update File: sections for the same path reports success for every section, but only the final section’s changes persist. Earlier updates are computed from the original file and then overwritten during the write phase, while the returned diff incorrectly shows all changes as applied.
This disproportionately affects GPT Astra, which frequently emits multiple Update File sections for the same file in one apply_patch call. The silent loss then causes unnecessary repair turns and token use.
Plugins
none
OpenCode version
1.18.30
Steps to reproduce
Use any gpt model and prompt:
Create a temporary text file with two distinct lines using apply_patch. Then, in a single subsequent apply_patch call, include two separate *** Update File: sections targeting that same file: change the first line in the first section and the second line in the second section. Read the file afterward and report its contents. Do not merge the two edits into one Update File section.
It will drop the first update in this apply_patch call.
Screenshot and/or share link
Operating System
Ubuntu 24.04
Terminal
Ghostty
Description
A single apply_patch call with multiple *** Update File: sections for the same path reports success for every section, but only the final section’s changes persist. Earlier updates are computed from the original file and then overwritten during the write phase, while the returned diff incorrectly shows all changes as applied.
This disproportionately affects GPT Astra, which frequently emits multiple Update File sections for the same file in one apply_patch call. The silent loss then causes unnecessary repair turns and token use.
Plugins
none
OpenCode version
1.18.30
Steps to reproduce
Use any gpt model and prompt:
Create a temporary text file with two distinct lines using apply_patch. Then, in a single subsequent apply_patch call, include two separate *** Update File: sections targeting that same file: change the first line in the first section and the second line in the second section. Read the file afterward and report its contents. Do not merge the two edits into one Update File section.
It will drop the first update in this apply_patch call.
Screenshot and/or share link
Operating System
Ubuntu 24.04
Terminal
Ghostty