Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Nov 25, 2025

This PR attempts to address Issue #9563. Feedback and guidance are welcome.

Problem

The apply_diff tool was incorrectly identifying HTML entities (like ') as identical to their decoded characters (like ') when processing JSX files. This caused valid diff operations to fail with "Search and replace content are identical" errors, preventing agents from fixing ESLint warnings about unescaped entities.

Root Cause

The issue was caused by the unescapeHtmlEntities function being applied to diff content for non-Claude models, which converted HTML entities to their literal characters before the comparison. This made doesn't and doesn't appear identical to the diff strategy.

Solution

  • Removed the HTML entity unescaping logic from ApplyDiffTool.ts
  • This ensures that diff content is compared using raw strings as provided by the agent
  • HTML entities are now correctly recognized as different from their decoded counterparts

Testing

  • Added comprehensive test suite in applyDiffTool.htmlentities.spec.ts
  • Tests verify that HTML entities are preserved in diff content
  • Tests confirm the fix works for both Claude and non-Claude models
  • All existing tests continue to pass

Impact

This fix enables agents to properly escape special characters in JSX files when addressing ESLint warnings about unescaped entities.

Fixes #9563


Important

Fixes HTML entity handling in apply_diff tool to prevent false identical content errors in JSX files.

  • Behavior:
    • Removed unescapeHtmlEntities logic from ApplyDiffTool.ts to preserve HTML entities in diff content.
    • Ensures diff content is compared using raw strings, preventing false identical content errors.
  • Testing:
    • Added applyDiffTool.htmlentities.spec.ts to test HTML entity handling.
    • Tests verify preservation of HTML entities and correct behavior for Claude and non-Claude models.
  • Impact:

This description was created by Ellipsis for 6609a39. You can customize this summary. It will automatically update as commits are pushed.

…ntent errors

Removed HTML entity unescaping for non-Claude models in ApplyDiffTool
This fixes the issue where HTML entities were incorrectly identified as identical to their decoded characters
Added comprehensive test coverage for HTML entity preservation
Resolves issue #9563 where JSX files with escaped entities failed to update
@roomote roomote bot requested review from cte, jr and mrubens as code owners November 25, 2025 06:21
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Nov 25, 2025
@roomote
Copy link
Contributor Author

roomote bot commented Nov 25, 2025

Rooviewer Clock   See task on Roo Cloud

Review complete. This PR correctly fixes the HTML entity handling issue by removing the unescaping logic that was causing false "identical content" errors. The changes are minimal, well-tested, and directly address the root cause described in issue #9563.

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[BUG] Roo things ' and ' are the same and fails to apply the change

3 participants