feat: show line count summary for Read tool results (#507)
Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
|||||||
import {
|
import {
|
||||||
getDisplayToolName,
|
getDisplayToolName,
|
||||||
isFileEditTool,
|
isFileEditTool,
|
||||||
|
isFileReadTool,
|
||||||
isFileWriteTool,
|
isFileWriteTool,
|
||||||
isMemoryTool,
|
isMemoryTool,
|
||||||
isPatchTool,
|
isPatchTool,
|
||||||
@@ -547,6 +548,28 @@ export const ToolCallMessage = memo(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if this is a file read tool - show line count summary
|
||||||
|
if (
|
||||||
|
isFileReadTool(rawName) &&
|
||||||
|
line.resultOk !== false &&
|
||||||
|
line.resultText
|
||||||
|
) {
|
||||||
|
// Count lines in the result (the content returned by Read tool)
|
||||||
|
const lineCount = line.resultText.split("\n").length;
|
||||||
|
return (
|
||||||
|
<Box flexDirection="row">
|
||||||
|
<Box width={prefixWidth} flexShrink={0}>
|
||||||
|
<Text>{prefix}</Text>
|
||||||
|
</Box>
|
||||||
|
<Box flexGrow={1} width={contentWidth}>
|
||||||
|
<Text>
|
||||||
|
Read <Text bold>{lineCount}</Text> lines
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Regular result handling
|
// Regular result handling
|
||||||
const isError = line.resultOk === false;
|
const isError = line.resultOk === false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user