From a76ff4db7d17fcfa1d0f62e40a463f3c25f5282a Mon Sep 17 00:00:00 2001 From: mawkone Date: Mon, 15 Jun 2026 15:10:18 -0700 Subject: [PATCH] Remove V avatar from chat panel --- vibn-frontend/app/api/chat/route.ts | 43 +++++++++++++++-------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/vibn-frontend/app/api/chat/route.ts b/vibn-frontend/app/api/chat/route.ts index 1fd7d8d1..e30d19a8 100644 --- a/vibn-frontend/app/api/chat/route.ts +++ b/vibn-frontend/app/api/chat/route.ts @@ -1714,26 +1714,6 @@ export async function POST(request: Request) { temperature: 0.3, signal: clientSignal, }); - if (summary.text && summary.text.trim()) { - assistantText += (assistantText ? "\n\n" : "") + summary.text; - assistantTextSegments.push(summary.text); - emit({ type: "text", text: summary.text }); - } else { - // Gemini returned empty — fall back to a deterministic but - // STRUCTURED build-health status (never a vague "didn't reach a - // clean stopping point"). It states what happened, what broke, - // and the next action, using the same signals as the telemetry - // stop_reason. - const fallback = buildHealthStatus({ - loopBreakReason, - hitRoundCap: maxToolRounds > 0 && round >= maxToolRounds, - lastError: extractLastToolFailure(messages), - toolCount: assistantToolCalls.length, - }); - assistantText += (assistantText ? "\n\n" : "") + fallback; - assistantTextSegments.push(fallback); - emit({ type: "text", text: fallback }); - } if (summary.thoughts) { assistantTimeline.push({ kind: "thought", @@ -1741,6 +1721,24 @@ export async function POST(request: Request) { }); emit({ type: "thinking", text: summary.thoughts }); } + + if (summary.text && summary.text.trim()) { + assistantTimeline.push({ kind: "text", text: summary.text }); + assistantText += (assistantText ? "\n\n" : "") + summary.text; + assistantTextSegments.push(summary.text); + emit({ type: "text", text: summary.text }); + } else { + const fallback = buildHealthStatus({ + loopBreakReason, + hitRoundCap: maxToolRounds > 0 && round >= maxToolRounds, + lastError: extractLastToolFailure(messages), + toolCount: assistantToolCalls.length, + }); + assistantTimeline.push({ kind: "text", text: fallback }); + assistantText += (assistantText ? "\n\n" : "") + fallback; + assistantTextSegments.push(fallback); + emit({ type: "text", text: fallback }); + } } catch { const fallback = buildHealthStatus({ loopBreakReason, @@ -1773,7 +1771,12 @@ export async function POST(request: Request) { temperature: 0.3, signal: clientSignal, }); + if (finalSummary.thoughts) { + assistantTimeline.push({ kind: "thought", text: finalSummary.thoughts }); + emit({ type: "thinking", text: finalSummary.thoughts }); + } if (finalSummary.text && finalSummary.text.trim()) { + assistantTimeline.push({ kind: "text", text: finalSummary.text }); assistantText += (assistantText ? "\n\n" : "") + finalSummary.text; assistantTextSegments.push(finalSummary.text);