-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
NOTE: THIS ISSUE WAS OPENED WITH THE OLD ISSUE-FIXER MODE
App Version
3.21.0 (accc5fb)
API Provider
Open Router
Model Used
Anthropic/Opus 4
🔁 Steps to Reproduce
- Start a task with Roo.
- Instruct Roo to modify a moderately large file (e.g., ~300 lines), specifically an XML file.
- Observe as Roo attempts to use the
apply_difftool.
💥 Outcome Summary
Expected: Roo applies the changes to the XML file successfully within a few seconds. The diff view loads, and the user can approve or reject the changes.
Actual: The "Roo wants to edit this file" dialog appears, but the progress bar hangs indefinitely. The file is never updated, and no error messages are shown in the UI or output channel. The operation must be manually canceled.
📄 Relevant Logs or Errors
No error messages or logs were observed.
Technical Analysis
Based on my investigation, the root cause appears to be related to how the apply_diff tool is implemented and potentially how it handles XML content.
-
Dual
apply_diffImplementations: The codebase contains two versions of theapply_difftool.- A newer, multi-file capable version in
src/core/tools/multiApplyDiffTool.ts. This is activated by theMULTI_FILE_APPLY_DIFFexperiment. It parses XML arguments to handle multiple files. - A legacy version,
applyDiffToolLegacy, insrc/core/tools/applyDiffTool.ts. This handles a single file via direct parameters.
- A newer, multi-file capable version in
-
Point of Failure: The hang occurs during the approval phase, after Roo has decided on the change but before the file is written. The issue is likely within the
applyDifffunction called from eithermultiApplyDiffTool.tsorapplyDiffTool.ts. -
Potential Cause: Given that the problematic content is XML, the issue could stem from:
- XML Parsing in
multiApplyDiffTool: The new tool's reliance onparseXmlcould be failing silently or entering an infinite loop when the diff content itself is malformed or complex XML. - HTML Entity Unescaping: Both tools unescape HTML entities from the diff content (
unescapeHtmlEntities(diffContent)). If the model provides XML content within an XML tool call, this double-parsing/unescaping could be corrupting the diff and causing the diffing library to hang. - Diff Strategy: The underlying
diffStrategymight have a performance bottleneck or bug when processing structured text like XML, especially with a large number of changes.
- XML Parsing in
Metadata
Metadata
Assignees
Labels
Type
Projects
Status