diff --git a/components/agent/AgentSheet.tsx b/components/agent/AgentSheet.tsx index 23faec84..d6aecefa 100644 --- a/components/agent/AgentSheet.tsx +++ b/components/agent/AgentSheet.tsx @@ -18,6 +18,8 @@ import AgentChat, { normalizeStoredMessages, type ChatMessage, } from './AgentChat' +import AskConsole, { type AskConsoleMessage } from './AskConsole' +import { CHAT_INTENT_ID } from '@/lib/agent/ask/persist' import type { AgentPanelFloatRect, StoredStagedOperation } from '@/types' import { DOCK_GUTTER, @@ -756,14 +758,35 @@ export default function AgentSheet({ ) : loaded ? ( - setConversationId(id)} - onStatus={onStatus} + loaded.intentId === CHAT_INTENT_ID ? ( + // Resumed free-form thread: the single-call console (runs on a local + // model). Its turns are text-only, so drop any empty/tool rows. + m.text.trim().length > 0) + .map((m): AskConsoleMessage => ({ role: m.role, text: m.text }))} + contextRef={loaded.contextRef} + /> + ) : ( + setConversationId(id)} + onStatus={onStatus} + /> + ) + ) : intentId === CHAT_INTENT_ID ? ( + // Fresh free-form ask (the FAB's "Fråga min assistent" catch-all). + setConversationId(id)} /> ) : (