Skip to content

Commit 586c79d

Browse files
committed
add error display
1 parent 7115651 commit 586c79d

File tree

1 file changed

+20
-12
lines changed
  • apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/message-content

1 file changed

+20
-12
lines changed

apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/message-content/tool-call-simple.tsx

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function ToolCallSimple({
6767
const toolName = toolInvocation.type.split('-')[1] ?? '';
6868
const Icon = TOOL_ICONS[toolName] ?? Icons.QuestionMarkCircled;
6969

70-
if(toolInvocation.state === 'output-available') {
70+
if (toolInvocation.state === 'output-available') {
7171
return null;
7272
}
7373

@@ -183,17 +183,25 @@ export function ToolCallSimple({
183183
}
184184
}
185185
return (
186-
<div className={cn('flex items-center gap-2 ml-2 text-foreground-tertiary/80', className)}>
187-
<Icon className="w-4 h-4" />
188-
<span
189-
className={cn(
190-
'text-regularPlus',
191-
loading &&
192-
'bg-gradient-to-l from-white/20 via-white/90 to-white/20 bg-[length:200%_100%] bg-clip-text text-transparent animate-shimmer filter drop-shadow-[0_0_10px_rgba(255,255,255,0.4)]'
193-
)}
194-
>
195-
{getLabel()}
196-
</span>
186+
<div className="flex flex-col gap-2">
187+
<div className={cn('flex items-center gap-2 ml-2 text-foreground-tertiary/80', className)}>
188+
<Icon className="w-4 h-4" />
189+
<span
190+
className={cn(
191+
'text-regularPlus',
192+
loading &&
193+
'bg-gradient-to-l from-white/20 via-white/90 to-white/20 bg-[length:200%_100%] bg-clip-text text-transparent animate-shimmer filter drop-shadow-[0_0_10px_rgba(255,255,255,0.4)]'
194+
)}
195+
>
196+
{getLabel()}
197+
</span>
198+
</div>
199+
{(toolInvocation.state === 'output-error') && (
200+
<div className="flex items-start gap-2 ml-2 text-red-500 text-small max-h-32 overflow-y-auto border-l">
201+
<Icons.ExclamationTriangle className="w-4 h-4" />
202+
<span className="text-regularPlus">{toolInvocation.errorText || 'Error calling tool'}</span>
203+
</div>
204+
)}
197205
</div>
198206
);
199207
}

0 commit comments

Comments
 (0)