Skip to content

apply_patch tool diff does not reflect formatter changes #15897

@JDNdeveloper

Description

@JDNdeveloper

Description

After using a model that uses the apply_patch tool (e.g. ChatGPT 5.3 Codex), the diff shown does not reflect the formatter changes that were also applied.

Plugins

No response

OpenCode version

1.2.15

Steps to reproduce

  1. Create a file named repro.py:
def a():
    """x"""
    return 'y'
  1. 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
  1. Inspect repro.py after patch. It becomes:
def a():
    """x updated"""
    return "y"
  1. Observe that the diff shown does NOT show the formatting change that was performed.

Screenshot and/or share link

edit tool:

Image

apply_patch tool:

Image

Operating System

Windows 11 WSL

Terminal

Windows Terminal

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)windows

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions