From f0e1b0f57a2c2280cef898f65a3bbed0b636d96b Mon Sep 17 00:00:00 2001 From: Saeed Kasmani Date: Sun, 9 Aug 2026 21:06:22 +1000 Subject: [PATCH] Fix assistant UI state selectors --- ui/src/components/Chat.jsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ui/src/components/Chat.jsx b/ui/src/components/Chat.jsx index 50fde3f..991a1ee 100644 --- a/ui/src/components/Chat.jsx +++ b/ui/src/components/Chat.jsx @@ -101,10 +101,13 @@ function UserMessage() { } function AssistantMessage() { - const message = useAuiState() - const isRunning = message.status?.type === 'running' - const hasText = message.content?.some(c => c.type === 'text' && c.text?.trim()) - const reasoningParts = message.content?.filter(c => c.type === 'reasoning') || [] + // Current assistant-ui versions require an explicit state selector. + // Subscribe only to the fields this message renderer uses so streaming + // updates remain stable and do not try to read the entire store. + const isRunning = useAuiState(s => s.message.status?.type === 'running') + const content = useAuiState(s => s.message.content) + const hasText = content?.some(c => c.type === 'text' && c.text?.trim()) + const reasoningParts = content?.filter(c => c.type === 'reasoning') || [] if (!hasText && isRunning) { return (