From ac17d9cb28d193bd3a03b66c9740ec2768b48350 Mon Sep 17 00:00:00 2001 From: Pascal Date: Thu, 2 Oct 2025 15:00:40 +0200 Subject: [PATCH 01/10] refactor: unify reasoning handling via backend reasoning_content, drop frontend tag parsing - Updated the chat message component to surface backend-supplied reasoning via message.thinking while showing the raw assistant content without inline tag scrubbing - Simplified chat streaming to append content chunks directly, stream reasoning into the message model, and persist any partial reasoning when generation stops - Refactored the chat service SSE handler to rely on server-provided reasoning_content, removing legacy parsing logic - Refreshed Storybook data and streaming flows to populate the thinking field explicitly for static and streaming assistant messages --- .../app/chat/ChatMessages/ChatMessage.svelte | 19 +-- tools/server/webui/src/lib/services/chat.ts | 96 ++---------- .../webui/src/lib/stores/chat.svelte.ts | 19 ++- tools/server/webui/src/lib/utils/thinking.ts | 143 ------------------ .../src/stories/ChatMessage.stories.svelte | 50 +++--- 5 files changed, 51 insertions(+), 276 deletions(-) delete mode 100644 tools/server/webui/src/lib/utils/thinking.ts diff --git a/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessage.svelte b/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessage.svelte index c923bf9e040de..83bde07abf6da 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessage.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessage.svelte @@ -1,7 +1,6 @@