diff --git a/apps/web/stores/chat.ts b/apps/web/stores/chat.ts index 7df867b02..456217b7f 100644 --- a/apps/web/stores/chat.ts +++ b/apps/web/stores/chat.ts @@ -27,9 +27,9 @@ export function areUIMessageArraysEqual( return false } - // Compare the entire message using JSON serialization as a fallback - // This handles all properties including parts, toolInvocations, etc. - if (JSON.stringify(msgA) !== JSON.stringify(msgB)) { + if (msgA.content !== msgB.content) return false + + if (JSON.stringify(msgA.parts) !== JSON.stringify(msgB.parts)) { return false } }