From 93b47d962a47852f560d0c77b1ff990e49f0fa9f Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Mon, 20 Apr 2026 15:25:29 -0500 Subject: [PATCH] fix(tui): auto-expand Activity on error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Activity accordion in ToolTrail tints red (via metaTone) when an error item is present, but stays collapsed — the error is invisible until the user clicks. Track the latest error id and force-open openMeta whenever it advances. Users can still manually collapse; a new error re-opens. --- ui-tui/src/components/thinking.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ui-tui/src/components/thinking.tsx b/ui-tui/src/components/thinking.tsx index 958333d6..2c741caa 100644 --- a/ui-tui/src/components/thinking.tsx +++ b/ui-tui/src/components/thinking.tsx @@ -596,6 +596,17 @@ export const ToolTrail = memo(function ToolTrail({ } }, [detailsMode]) + const latestErrorId = useMemo( + () => activity.reduce((max, i) => (i.tone === 'error' && i.id > max ? i.id : max), -1), + [activity] + ) + + useEffect(() => { + if (latestErrorId >= 0) { + setOpenMeta(true) + } + }, [latestErrorId]) + const cot = useMemo(() => thinkingPreview(reasoning, 'full', THINKING_COT_MAX), [reasoning]) if (