+ {#each sections as section, index (index)}
+ {#if section.type === 'text'}
+
+
+
+ {:else if section.type === 'tool_call_streaming'}
+
+
+
+
+
+ {#if section.toolName}
+ {section.toolName}
+ {/if}
+ preparing...
+
+
+
+ {:else if section.type === 'tool_call' || section.type === 'tool_call_pending'}
+ {@const isPending = section.type === 'tool_call_pending'}
+
+
+ toggleExpanded(index, isPending)}
+ >
+
+ {#if isPending}
+
+ {:else}
+
+ {/if}
+ {section.toolName}
+ {#if isPending}
+ executing...
+ {/if}
+
+
+
+
+ Toggle tool call content
+
+
+
+
+
+ {#if section.toolArgs && section.toolArgs !== '{}'}
+
+ {/if}
+
+
+
+ Result:
+ {#if isPending}
+
+ {/if}
+
+ {#if section.toolResult}
+
+
+
{section.toolResult}
+
+ {:else if isPending}
+
+ Waiting for result...
+
+ {/if}
+
+
+
+
+
+ {/if}
+ {/each}
+
+
+
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 220276fc9e3..9eedf8a4e30 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
@@ -69,29 +69,6 @@
return null;
});
- let toolCallContent = $derived.by((): ApiChatCompletionToolCall[] | string | null => {
- if (message.role === 'assistant') {
- const trimmedToolCalls = message.toolCalls?.trim();
-
- if (!trimmedToolCalls) {
- return null;
- }
-
- try {
- const parsed = JSON.parse(trimmedToolCalls);
-
- if (Array.isArray(parsed)) {
- return parsed as ApiChatCompletionToolCall[];
- }
- } catch {
- // Harmony-only path: fall back to the raw string so issues surface visibly.
- }
-
- return trimmedToolCalls;
- }
- return null;
- });
-
function handleCancelEdit() {
isEditing = false;
editedContent = message.content;
@@ -281,6 +258,5 @@
{showDeleteDialog}
{siblingInfo}
{thinkingContent}
- {toolCallContent}
/>
{/if}
diff --git a/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessageActions.svelte b/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessageActions.svelte
index 3cb48157d8c..dbd9b982285 100644
--- a/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessageActions.svelte
+++ b/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessageActions.svelte
@@ -5,6 +5,7 @@
ChatMessageBranchingControls,
DialogConfirmation
} from '$lib/components/app';
+ import { Switch } from '$lib/components/ui/switch';
interface Props {
role: 'user' | 'assistant';
@@ -26,6 +27,9 @@
onConfirmDelete: () => void;
onNavigateToSibling?: (siblingId: string) => void;
onShowDeleteDialogChange: (show: boolean) => void;
+ showRawOutputSwitch?: boolean;
+ rawOutputEnabled?: boolean;
+ onRawOutputToggle?: (enabled: boolean) => void;
}
let {
@@ -42,7 +46,10 @@
onRegenerate,
role,
siblingInfo = null,
- showDeleteDialog
+ showDeleteDialog,
+ showRawOutputSwitch = false,
+ rawOutputEnabled = false,
+ onRawOutputToggle
}: Props = $props();
function handleConfirmDelete() {
@@ -51,9 +58,9 @@
}
-