diff --git a/apps/desktop/layer/renderer/src/modules/ai-chat/components/message/ToolInvocationComponent.tsx b/apps/desktop/layer/renderer/src/modules/ai-chat/components/message/ToolInvocationComponent.tsx index cfd2311ad..40ea3bc94 100644 --- a/apps/desktop/layer/renderer/src/modules/ai-chat/components/message/ToolInvocationComponent.tsx +++ b/apps/desktop/layer/renderer/src/modules/ai-chat/components/message/ToolInvocationComponent.tsx @@ -25,6 +25,17 @@ export const ToolInvocationComponent: React.FC = R // Generate a unique value for this accordion item const accordionValue = `tool-${"toolCallId" in part ? part.toolCallId : Math.random()}` + const result = React.useMemo(() => { + if (hasResult) { + const string = JSON.stringify(part.output, null, 2) + if (string.length > 1000) { + return `${string.slice(0, 1000)}\n...` + } else { + return string + } + } + }, [hasResult, part]) + return (
= R
Result:
) : null}