Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jan 9, 2026

Fixes ROO-419: Roo shows project root as edit target when pathname lags

Problem

When using native tool calling, JSON arguments stream incrementally and the content/diff parameters often arrive before the path parameter. This caused the UI to render file editing operations with an undefined path, which displayed as the project root directory, creating confusing UX where users saw "wants to edit this file" pointing to the project root instead of the actual target file.

Root Cause

In NativeToolCallParser.createPartialToolUse(), the conditions for write_to_file and apply_diff used OR logic (||), allowing nativeArgs creation when only content/diff was present but path was undefined:

// Before - allows undefined path
if (partialArgs.path || partialArgs.content) {
    nativeArgs = { path: partialArgs.path, content: partialArgs.content }
}

Solution

Changed the conditions to require BOTH parameters before creating nativeArgs (using AND logic &&):

// After - requires both parameters
if (partialArgs.path && partialArgs.content) {
    nativeArgs = { path: partialArgs.path, content: partialArgs.content }
}

Changes

  • Modified createPartialToolUse() in NativeToolCallParser.ts (lines 387-396 and 407-416)
  • Added explanatory comments documenting the fix
  • Included detailed investigation documentation in INVESTIGATION-ROO-419.md

Impact

✅ Users no longer see confusing "project root" as the edit target
✅ File editing operations wait until the complete path is available before displaying
✅ Improves trust and clarity in file modification operations
✅ No impact on final rendering or execution - only affects streaming partial updates
✅ Consistent with how other required parameters are handled

Testing

  • Code changes are minimal and focused on streaming UX
  • No changes to final tool execution logic
  • The fix prevents incomplete partial updates from reaching the UI

View task on Roo Code Cloud


Important

Fixes UI issue in NativeToolCallParser.ts by requiring both path and content for write_to_file and path and diff for apply_diff.

  • Behavior:
    • Fixes issue where UI shows project root as edit target when path is undefined in NativeToolCallParser.ts.
    • Changes logic in createPartialToolUse() to require both path and content for write_to_file and path and diff for apply_diff.
  • Comments:
    • Adds comments in NativeToolCallParser.ts explaining the logic change to prevent undefined paths.
  • Documentation:
    • Adds INVESTIGATION-ROO-419.md documenting the issue and solution.

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

…treaming

Fixes ROO-419

When using native tool calling, JSON arguments stream incrementally and
content/diff parameters often arrive before path. This caused the UI to
render file editing operations with undefined path, displaying as the
project root and creating confusing UX.

Changes:
- Modified createPartialToolUse() in NativeToolCallParser.ts to require
  BOTH path and content/diff before creating nativeArgs for write_to_file
  and apply_diff tools
- Changed condition from OR (||) to AND (&&) for these file editing tools
- Prevents rendering partial tool use until complete file path is available

Impact:
- Users no longer see confusing "project root" as edit target
- File editing operations wait until path is fully streamed before display
- Improves trust and clarity in file modification operations
- No impact on final rendering or execution, only affects partial updates
@roomote roomote bot requested review from cte, jr and mrubens as code owners January 9, 2026 11:30
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working Documentation Improvements or additions to documentation labels Jan 9, 2026
@roomote
Copy link
Contributor Author

roomote bot commented Jan 9, 2026

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

The latest commit removes the investigation documentation per reviewer feedback, keeping only the code changes. The fix correctly addresses the streaming UX issue by requiring both path and content/diff parameters before creating nativeArgs for write_to_file and apply_diff tools.

Previous reviews

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

@brunobergher
Copy link
Collaborator

@roomote remove the markdown plan added in this PR, leave only the code changes.

@roomote
Copy link
Contributor Author

roomote bot commented Jan 9, 2026

Fixaroo Clock   See task on Roo Cloud

Removed the INVESTIGATION-ROO-419.md file, keeping only the code changes.

View commit | Revert commit

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jan 9, 2026
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Documentation Improvements or additions to documentation Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

4 participants