Skip to content

Conversation

@0xMink
Copy link
Contributor

@0xMink 0xMink commented Feb 11, 2026

Closes #10804

Summary

  • Remove unescapeHtmlEntities() calls from WriteToFileTool, ApplyDiffTool, and ExecuteCommandTool that converted HTML entities (<, >, &, ', ") to literal characters during file writes, diff application, and command execution
  • This conversion corrupted HTML/JSX/TSX content (e.g., &apos; becoming ' breaks JSX attributes, &lt; becoming < breaks HTML entity display)
  • Commands containing shell-significant characters were also affected — &gt; was silently converted to > before execution
  • Removed the now-redundant canonicalCommand alias per review feedback

Background

HTML entity decoding was originally added in PR #2120 (Mar 2025) as a workaround for XML-encoded tool-call payloads. When models used the XML tool protocol, special characters in tool parameters were XML-encoded (& became &amp;, < became &lt;, etc.), so the tool layer decoded them before execution. Over time the same decoding was applied to file writes and diff application, where it caused data corruption by mutating HTML/JSX/TSX content. The XML tool protocol has since been removed entirely — the codebase now uses native JSON tool calls exclusively, which do not XML-encode parameters. The unescapeHtmlEntities() calls are no longer needed.

Test plan

  • Existing: 37 tests pass across 3 test files (executeCommandTool, executeCommandTimeout, writeToFileTool)
  • Modified: HTML entity tests now assert preservation instead of conversion (executeCommandTool.spec.ts, writeToFileTool.spec.ts)
  • Modified: Removed stale text-normalization mock from integration tests (executeCommandTimeout.integration.spec.ts)

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Feb 11, 2026
@roomote
Copy link
Contributor

roomote bot commented Feb 11, 2026

Rooviewer Clock   See task

All previous feedback addressed. No new issues found.

  • Remove the now-redundant canonicalCommand alias in ExecuteCommandTool.ts (line 45)
Previous reviews

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

@0xMink 0xMink force-pushed the fix/preserve-html-entities-10804 branch from ab77708 to b5c9f10 Compare February 11, 2026 02:58
@0xMink
Copy link
Contributor Author

0xMink commented Feb 11, 2026

Applied nit: removed canonicalCommand alias and used command directly. Tests still passing (37/37).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

2 participants