From 47c3f496a0d9d6891c717be14972218790f3cc2d Mon Sep 17 00:00:00 2001 From: Hannes Rudolph Date: Mon, 26 Jan 2026 19:36:07 -0700 Subject: [PATCH] feat(ui): add read_command_output activity indicator Show read progress in chat when read_command_output tool is used: - Display 'Roo read command output (0 B - 100 KB of 263.3 KB)' - Shows the specific byte range being read each call - Uses same visual style as read_file tool - Add 'tool' to ClineSay types - Add readCommandOutput to ClineSayTool with readStart/readEnd/totalBytes --- src/core/tools/ReadCommandOutputTool.ts | 19 +++++++++++++++++++ webview-ui/src/components/chat/ChatRow.tsx | 1 - 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/core/tools/ReadCommandOutputTool.ts b/src/core/tools/ReadCommandOutputTool.ts index 7d83c16fba..e7aaf91135 100644 --- a/src/core/tools/ReadCommandOutputTool.ts +++ b/src/core/tools/ReadCommandOutputTool.ts @@ -159,15 +159,34 @@ export class ReadCommandOutputTool extends BaseTool<"read_command_output"> { } let result: string + let readStart = 0 + let readEnd = 0 if (search) { // Search mode: filter lines matching the pattern result = await this.searchInArtifact(artifactPath, search, totalSize, limit) + // For search, we're scanning the whole file + readStart = 0 + readEnd = totalSize } else { // Normal read mode with offset/limit result = await this.readArtifact(artifactPath, offset, limit, totalSize) + // Calculate actual read range + readStart = offset + readEnd = Math.min(offset + limit, totalSize) } + // Report to UI that we read command output + await task.say( + "tool", + JSON.stringify({ + tool: "readCommandOutput", + readStart, + readEnd, + totalBytes: totalSize, + }), + ) + task.consecutiveMistakeCount = 0 pushToolResult(result) } catch (error) { diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx index 6a6d5c3f6d..c79dd11a86 100644 --- a/webview-ui/src/components/chat/ChatRow.tsx +++ b/webview-ui/src/components/chat/ChatRow.tsx @@ -1470,7 +1470,6 @@ export const ChatRowContent = ({ if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB` return `${(bytes / (1024 * 1024)).toFixed(1)} MB` } - // Determine if this is a search operation const isSearch = sayTool.searchPattern !== undefined