From ce91bc3faa591954c1a153290c20816fec5c72b3 Mon Sep 17 00:00:00 2001 From: ciregenz Date: Tue, 4 Aug 2026 10:38:11 -0700 Subject: [PATCH] [eric] chat: the embedded composer stops chanting Send a message, per-chat lines that flip to follow-up voice --- frontend/src/app/pages/AgentChat/AgentChat.tsx | 3 ++- .../src/app/pages/AgentChat/composerPlaceholder.ts | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 frontend/src/app/pages/AgentChat/composerPlaceholder.ts diff --git a/frontend/src/app/pages/AgentChat/AgentChat.tsx b/frontend/src/app/pages/AgentChat/AgentChat.tsx index ccf3b407..617390a8 100644 --- a/frontend/src/app/pages/AgentChat/AgentChat.tsx +++ b/frontend/src/app/pages/AgentChat/AgentChat.tsx @@ -64,6 +64,7 @@ import ToolGroupBubble, { RenderItem, ToolGroup, ToolGroupEntry, isToolGroup, is import ToolUiBubble from './tool-ui/ToolUiBubble'; import AskUiBubble from './tool-ui/AskUiBubble'; import { isShowUiPair, isAskUiPair, extractPendingAskUi } from './tool-ui/showUiPayload'; +import { composerPlaceholder } from './composerPlaceholder'; import ApprovalBar, { BatchApprovalBar } from './shell/ApprovalBar'; import ForceStopAgentBar from './ForceStopAgentBar'; import { RateLimitPill } from './shell/RateLimitPill'; @@ -2464,7 +2465,7 @@ const AgentChat: React.FC = ({ sessionId: sessionIdProp, onClose sessionId={id} autoFocus={autoFocus} prefillPrompt={prefillPrompt} - placeholderOverride={runContext ? 'Ask about this run...' : embedded ? 'Send a message...' : undefined} + placeholderOverride={runContext ? 'Ask about this run...' : embedded ? composerPlaceholder(session.id, (session.messages || []).some((mm) => mm.role === 'assistant')) : undefined} runContext={runContext} onClearRunContext={onClearRunContext} thinkingLevel={session?.thinking_level ?? 'auto'} diff --git a/frontend/src/app/pages/AgentChat/composerPlaceholder.ts b/frontend/src/app/pages/AgentChat/composerPlaceholder.ts new file mode 100644 index 00000000..13766892 --- /dev/null +++ b/frontend/src/app/pages/AgentChat/composerPlaceholder.ts @@ -0,0 +1,10 @@ +const FRESH = ['What should we do?', 'Give me a task...', "What's on your mind?", 'Ask me anything...']; +const FOLLOWUP = ['Reply or take it further...', 'What next?', 'Ask a follow-up...', 'Keep going or change course...']; + +/** A composer that always says "Send a message..." reads canned; pick a stable per-chat line, follow-up flavored once the agent has spoken. */ +export function composerPlaceholder(sessionId: string, hasReply: boolean): string { + let h = 0; + for (let i = 0; i < sessionId.length; i++) h = (h * 31 + sessionId.charCodeAt(i)) >>> 0; + const pool = hasReply ? FOLLOWUP : FRESH; + return pool[h % pool.length]; +}