fix: prevent showing project root when pathname lags in native tool streaming (ROO-419) #10572
+6
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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/diffparameters often arrive before thepathparameter. 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 forwrite_to_fileandapply_diffused OR logic (||), allowingnativeArgscreation when only content/diff was present but path was undefined:Solution
Changed the conditions to require BOTH parameters before creating
nativeArgs(using AND logic&&):Changes
createPartialToolUse()inNativeToolCallParser.ts(lines 387-396 and 407-416)INVESTIGATION-ROO-419.mdImpact
✅ 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
View task on Roo Code Cloud
Important
Fixes UI issue in
NativeToolCallParser.tsby requiring bothpathandcontentforwrite_to_fileandpathanddiffforapply_diff.pathis undefined inNativeToolCallParser.ts.createPartialToolUse()to require bothpathandcontentforwrite_to_fileandpathanddiffforapply_diff.NativeToolCallParser.tsexplaining the logic change to prevent undefined paths.INVESTIGATION-ROO-419.mddocumenting the issue and solution.This description was created by
for c2aed49. You can customize this summary. It will automatically update as commits are pushed.