Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/core/tools/MultiApplyDiffTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,15 @@ ${errorDetails ? `\nTechnical details:\n${errorDetails}\n` : ""}
// Call saveChanges to update the DiffViewProvider properties
await cline.diffViewProvider.saveChanges(diagnosticsEnabled, writeDelayMs)
}

// Send final tool message with diff stats to update the UI
const finalMessage = JSON.stringify({
...sharedMessageProps,
diff: diffContents,
content: unifiedPatch,
diffStats: computeDiffStats(unifiedPatch) || undefined,
} satisfies ClineSayTool)
await cline.ask("tool", finalMessage, false).catch(() => {})
} else {
// Batch operations - already approved above
if (isPreventFocusDisruptionEnabled) {
Expand All @@ -687,6 +696,18 @@ ${errorDetails ? `\nTechnical details:\n${errorDetails}\n` : ""}
// Call saveChanges to update the DiffViewProvider properties
await cline.diffViewProvider.saveChanges(diagnosticsEnabled, writeDelayMs)
}

// Send final tool message with diff stats for batch operations
const diffContents = diffItems.map((item) => item.content).join("\n\n")
const unifiedPatchRaw = formatResponse.createPrettyPatch(relPath, beforeContent!, originalContent!)
const unifiedPatch = sanitizeUnifiedDiff(unifiedPatchRaw)
const finalMessage = JSON.stringify({
...sharedMessageProps,
diff: diffContents,
content: unifiedPatch,
diffStats: computeDiffStats(unifiedPatch) || undefined,
} satisfies ClineSayTool)
await cline.ask("tool", finalMessage, false).catch(() => {})
Comment on lines +700 to +710
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This final message will be sent for EACH file in a batch operation (once per loop iteration), rather than once after all batch files are processed. For a batch of 3 files, this creates 3 separate final messages with individual file stats instead of one consolidated message. The final message should be moved outside the for (const opResult of operationResults) loop (after line 742) to only send once per batch.

Fix it with Roo Code or mention @roomote and request a fix.

}

// Track file edit operation
Expand Down
Loading