diff --git a/components/chat-message-display.tsx b/components/chat-message-display.tsx index 1429c31..81c80e7 100644 --- a/components/chat-message-display.tsx +++ b/components/chat-message-display.tsx @@ -451,11 +451,24 @@ export function ChatMessageDisplay({ Complete )} - {state === "output-error" && ( - - Error - - )} + {state === "output-error" && + (() => { + // Check if this is a truncation (incomplete XML) vs real error + const isTruncated = + (toolName === "display_diagram" || + toolName === "append_diagram") && + (!input?.xml || + !input.xml.includes("")) + return isTruncated ? ( + + Truncated + + ) : ( + + Error + + ) + })()} {input && Object.keys(input).length > 0 && (