From abf44e2197820305afd2f281abb8d1205315a961 Mon Sep 17 00:00:00 2001 From: Alice Hau <110418948+ahau-square@users.noreply.github.com> Date: Tue, 11 Mar 2025 19:56:20 -0400 Subject: [PATCH] fix: fix tool output expansion checks (#1634) --- ui/desktop/src/components/ToolCallWithResponse.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/desktop/src/components/ToolCallWithResponse.tsx b/ui/desktop/src/components/ToolCallWithResponse.tsx index ce1926dc..6fed12cb 100644 --- a/ui/desktop/src/components/ToolCallWithResponse.tsx +++ b/ui/desktop/src/components/ToolCallWithResponse.tsx @@ -100,7 +100,9 @@ function ToolResultView({ result }: ToolResultViewProps) { const shouldShowExpanded = (item: Content, index: number) => { return ( - (item.annotations.priority !== undefined && item.annotations.priority >= 0.5) || + (item.annotations && + item.annotations.priority !== undefined && + item.annotations.priority >= 0.5) || expandedItems.includes(index) ); }; @@ -110,7 +112,9 @@ function ToolResultView({ result }: ToolResultViewProps) { {filteredResults.map((item, index) => { const isExpanded = shouldShowExpanded(item, index); const shouldMinimize = - item.annotations.priority === undefined || item.annotations.priority < 0.5; + !item.annotations || + item.annotations.priority === undefined || + item.annotations.priority < 0.5; return (
{shouldMinimize && (