Skip to content

Diff tool incorrectly treats < and &lt; as identicalΒ #7964

@WAcry

Description

@WAcry

App Version

3.28.1

API Provider

OpenAI Compatible

Model Used

GPT 5

Roo Code Task Links (Optional)

No response

πŸ” Steps to Reproduce

Description:
When applying diffs to files, the diff tool incorrectly normalizes < and &lt; as equivalent, causing false positives where no changes are detected. As a result, valid diffs that replace escaped generic type syntax (&lt;...&gt;) with real generic type syntax (<...>) are ignored.

Steps to Reproduce:

  1. Have a file containing escaped generics:

    .FilterBatch&lt;int&gt;(batch =&gt; batch.Count == 3)
    .MapBatch&lt;int, int&gt;(batch =&gt; batch.Sum())
  2. Apply a diff that replaces &lt; / &gt; with < / >:

LLM is suggesting:

<![CDATA[
<<<<<<< SEARCH
                    .FilterBatch&lt;int&gt;(batch =&gt; batch.Count == 3)
=======
                    .FilterBatch<int>(batch => batch.Count == 3)
>>>>>>> REPLACE
]]>

<![CDATA[
<<<<<<< SEARCH
                    .MapBatch&lt;int, int&gt;(batch =&gt; batch.Sum())
=======
                    .MapBatch<int, int>(batch => batch.Sum())
>>>>>>> REPLACE
]]>
  1. The diff tool reports:
Diff 1: Search and replace content are identical - no changes would be made

Debug Info:
- Search and replace must be different to make changes
- Use read_file to verify the content you want to change
tests/TorqueFlow.Tests/DslTests.cs - Diff 2: Search and replace content are identical - no changes would be made

Debug Info:
- Search and replace must be different to make changes
- Use read_file to verify the content you want to change

πŸ’₯ Outcome Summary

Expected Behavior:
The tool should recognize < and < (likewise > and >) as different tokens, and apply the replacement accordingly.

Actual Behavior:
The diff tool normalizes them as equivalent, leading to false negatives and preventing legitimate replacements.

πŸ“„ Relevant Logs or Errors (Optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue/PR - TriageNew issue. Needs quick review to confirm validity and assign labels.bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions