From 326e71822ef79aacee122115483b6f08610d67db Mon Sep 17 00:00:00 2001 From: Brian Love Date: Mon, 11 May 2026 13:02:11 -0700 Subject: [PATCH] fix(chat): GenUI turn skeleton suppresses markdown branch entirely MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Live smoke against PR #246's architecture revealed the classifier patience fix isn't enough on its own: during the sub-LLM phase of a GenUI run, raw JSON envelopes stream INTO the assistant message's content BEFORE emit_generated_surface wraps them with the A2UI prefix. The first chunks arrive as '[' (JSON array open) which the classifier locks in as 'markdown' — and the patience fix only protects the '-' first-char ambiguity. Fix: on a GenUI turn, suppress chat-streaming-md unconditionally until the classifier resolves to 'a2ui' or 'json-render'. Branches restructured as @else if so they're mutually exclusive, preventing any flash of streaming JSON. Once emit_generated_surface's wrapped payload arrives and the classifier's reset-on-shrink path re-classifies to 'a2ui', the skeleton hands off to the rendered surface. --- .../chat/src/lib/compositions/chat/chat.component.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libs/chat/src/lib/compositions/chat/chat.component.ts b/libs/chat/src/lib/compositions/chat/chat.component.ts index 86888fc56..f7c135354 100644 --- a/libs/chat/src/lib/compositions/chat/chat.component.ts +++ b/libs/chat/src/lib/compositions/chat/chat.component.ts @@ -164,10 +164,16 @@ import type { ChatRenderEvent } from './chat-render-event'; - @if ((pending || (classified.type() === 'a2ui' && classified.a2uiSurfaces().size === 0)) && genuiTurn) { + @if (genuiTurn && classified.type() !== 'a2ui' && classified.type() !== 'json-render') { + - } - @if (classified.markdown(); as md) { + } @else if (classified.type() === 'a2ui' && classified.a2uiSurfaces().size === 0 && genuiTurn) { + + + } @else if (classified.markdown(); as md) { } @if (classified.spec(); as spec) {