From ef4a06a57ca5635cde8c2eef780ad2e29d5bfb71 Mon Sep 17 00:00:00 2001 From: mawkone Date: Tue, 9 Jun 2026 15:02:34 -0700 Subject: [PATCH] ux(chat): tune silent-loop status nudge threshold to 6 rounds and strip leaked tool trace payloads from UI --- vibn-frontend/app/api/chat/route.ts | 8 ++++---- vibn-frontend/components/vibn-chat/chat-panel.tsx | 13 +++++++++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/vibn-frontend/app/api/chat/route.ts b/vibn-frontend/app/api/chat/route.ts index d8d8a3c..7260ced 100644 --- a/vibn-frontend/app/api/chat/route.ts +++ b/vibn-frontend/app/api/chat/route.ts @@ -837,16 +837,16 @@ export async function POST(request: Request) { // guide the model to respond in plain text for conversational inputs. const toolDefs = activeMcpToken ? VIBN_TOOL_DEFINITIONS : []; - // Every 8 silent rounds or 12 tool calls, gently nudge the model to surface a one-liner + // Every 6 silent rounds or 8 tool calls, gently nudge the model to surface a one-liner // status before continuing. This is the user's only signal of - // life when a tool chain runs long, but we keep the threshold high so it doesn't distract. - const isSilent = roundsSinceText >= 30 || toolCallsSinceText >= 12; + // life when a tool chain runs long. + const isSilent = roundsSinceText >= 6 || toolCallsSinceText >= 8; let extraSystem = isSilent ? "\n\n[STATUS NUDGE] You have run " + `${toolCallsSinceText} tool call(s) over ${roundsSinceText} round(s) ` + "without sending the user any text. Before any more tool calls, " + "send ONE short sentence describing what you are currently working " + - "on and why. The user is staring at silent tool pills." + "on and why. The user is staring at a silent screen." : ""; // When withholding tools on round 1 (conversational guard), add a diff --git a/vibn-frontend/components/vibn-chat/chat-panel.tsx b/vibn-frontend/components/vibn-chat/chat-panel.tsx index dbe0ae6..eec2cda 100644 --- a/vibn-frontend/components/vibn-chat/chat-panel.tsx +++ b/vibn-frontend/components/vibn-chat/chat-panel.tsx @@ -479,6 +479,13 @@ function ThinkingBubble({ thoughts }: { thoughts: string }) { ); } +function stripRawToolLogs(text: string): string { + if (!text) return text; + return text + .replace(/(?:\r?\n)*\[tools executed this turn:[\s\S]*?\]/g, "") + .trim(); +} + const MessageBubble = React.memo(function MessageBubble({ msg, }: { @@ -573,7 +580,7 @@ const MessageBubble = React.memo(function MessageBubble({ )} @@ -666,7 +673,9 @@ function TimelineText({ text }: { text: string }) { > );