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
This commit is contained in:
Hannes Rudolph 2026-01-26 19:36:07 -07:00
parent cd1b9f43fd
commit 47c3f496a0
2 changed files with 19 additions and 1 deletions

View file

@ -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) {

View file

@ -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