-
{prefixText}
{#if summaryText}
diff --git a/src/lib/components/chat/Messages/structuredOutput.ts b/src/lib/components/chat/Messages/structuredOutput.ts
index 40e509457a..bb5eee4e66 100644
--- a/src/lib/components/chat/Messages/structuredOutput.ts
+++ b/src/lib/components/chat/Messages/structuredOutput.ts
@@ -146,7 +146,9 @@ function buildToolCallToken(item: OutputItem, toolOutputByCallId: Record
>('i18n');
import { slide } from 'svelte/transition';
import { quintOut } from 'svelte/easing';
@@ -100,9 +102,14 @@
open || needsApproval || needsInput || (Array.isArray(embeds) && embeds.length > 0)
? decode(attributes?.arguments ?? '')
: '';
- $: isDone = attributes?.done === 'true';
$: isRejected = attributes?.status === 'rejected';
- $: isExecuting = !needsApproval && !needsInput && attributes?.done && attributes?.done !== 'true';
+ $: isDone =
+ attributes?.done === 'true' ||
+ attributes?.status === 'failed' ||
+ attributes?.status === 'incomplete';
+ $: isExecuting = !isDone && !isRejected && attributes?.status === 'completed';
+ $: isPreparing = !isDone && !isRejected && !needsApproval && !needsInput && !isExecuting;
+ $: isActive = isPreparing || isExecuting;
$: parsedArgs = parseArguments(args);
$: parsedResult = parseJSONString(result);
@@ -151,12 +158,12 @@
on:keydown={toggleOpenOnKeydown}
>
- {#if isExecuting}
+ {#if isActive}
@@ -180,14 +187,16 @@
{attributes.name}
- {#if isDone}
+ {#if isRejected}
+ {$i18n.t('Denied {{NAME}}', { NAME: attributes.name })}
+ {:else if isDone}
{$i18n.t('View Result from {{NAME}}', { NAME: attributes.name })}
{:else if needsInput}
{$i18n.t('Input needed')}
{:else if needsApproval}
{$i18n.t('Allow {{NAME}}?', { NAME: attributes.name })}
- {:else if isRejected}
- {$i18n.t('Denied {{NAME}}', { NAME: attributes.name })}
+ {:else if isPreparing}
+ {$i18n.t('Preparing {{NAME}}...', { NAME: attributes.name })}
{:else}
{$i18n.t('Executing {{NAME}}...', { NAME: attributes.name })}
{/if}