From 4a9e45b40bfdcfe184f03487fe499eb0e20c184c Mon Sep 17 00:00:00 2001 From: vikingowl Date: Fri, 2 Jan 2026 20:34:53 +0100 Subject: [PATCH] fix: persist toolCalls to database for reload persistence Tool usage was not showing after page reload because the toolCalls field was not being included when saving assistant messages to the database. Now toolCalls are properly persisted and restored. --- frontend/src/lib/components/chat/ChatWindow.svelte | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/chat/ChatWindow.svelte b/frontend/src/lib/components/chat/ChatWindow.svelte index b07593d..acaf7d4 100644 --- a/frontend/src/lib/components/chat/ChatWindow.svelte +++ b/frontend/src/lib/components/chat/ChatWindow.svelte @@ -604,12 +604,16 @@ // The results are stored in toolCalls and displayed by ToolCallDisplay } - // Persist the assistant message (without flooding text content) + // Persist the assistant message (including toolCalls for reload persistence) if (conversationId && assistantNode) { const parentOfAssistant = assistantNode.parentId; await addStoredMessage( conversationId, - { role: 'assistant', content: assistantNode.message.content }, + { + role: 'assistant', + content: assistantNode.message.content, + toolCalls: assistantNode.message.toolCalls + }, parentOfAssistant, assistantMessageId );