mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-22 09:34:53 +02:00
[eric] chat: the embedded composer stops chanting Send a message, per-chat lines that flip to follow-up voice
This commit is contained in:
@@ -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<AgentChatProps> = ({ 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'}
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
Reference in New Issue
Block a user