Description
Using apply_patch to make a one-line docstring change in a Python file can also rewrite unrelated lines in the same file. I consistently see extra formatting changes such as quote normalization (' to ") even when only one line is targeted.
Plugins
None
OpenCode version
1.2.15
Steps to reproduce
- Create a file named
repro.py:
def a():
"""x"""
return 'y'
- Apply this patch to
repro.py (ask the agent to update "x" to "x updated"):
*** Begin Patch
*** Update File: /absolute/path/to/repro.py
@@
- """x"""
+ """x updated"""
*** End Patch
- Inspect
repro.py after patch. It becomes:
def a():
"""x updated"""
return "y"
Note the edit to return "y".
Screenshot and/or share link
No response
Operating System
Windows 11 WSL
Terminal
Windows Terminal
Description
Using apply_patch to make a one-line docstring change in a Python file can also rewrite unrelated lines in the same file. I consistently see extra formatting changes such as quote normalization (' to ") even when only one line is targeted.
Plugins
None
OpenCode version
1.2.15
Steps to reproduce
repro.py:repro.py(ask the agent to update "x" to "x updated"):repro.pyafter patch. It becomes:Note the edit to
return "y".Screenshot and/or share link
No response
Operating System
Windows 11 WSL
Terminal
Windows Terminal