fix: check for errorText field in tool error rendering

AI SDK streams use "errorText" field for tool errors, not "error".
Updated MessageBubble to check both errorText and error for compatibility.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ajax Davis 2025-12-04 15:04:54 +10:00
parent 19837ae800
commit 934c8e9c0b

View file

@ -94,13 +94,13 @@ export function MessageBubble({
)}
{/* Tool Error */}
{toolPart.error && (
{(toolPart.errorText || toolPart.error) && (
<div>
<div className="mb-1 text-xs font-semibold text-red-500">Error:</div>
<pre className="overflow-x-auto rounded bg-red-500/10 p-2 text-xs text-red-400">
{typeof toolPart.error === 'string'
? toolPart.error
: JSON.stringify(toolPart.error, null, 2)}
{typeof (toolPart.errorText || toolPart.error) === 'string'
? toolPart.errorText || toolPart.error
: JSON.stringify(toolPart.errorText || toolPart.error, null, 2)}
</pre>
</div>
)}