Skip to content

Commit 3462b8f

Browse files
committed
perf: skip artifact extraction during streaming to prevent UI freezes
1 parent 24482b4 commit 3462b8f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/lib/components/chat/Chat.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,11 @@
863863
};
864864
865865
$: if (history) {
866-
getContents();
866+
// Skip artifact extraction during streaming to avoid expensive regex
867+
// on the entire chat history for every incoming chunk
868+
if (!generating) {
869+
getContents();
870+
}
867871
} else {
868872
artifactContents.set([]);
869873
}

0 commit comments

Comments
 (0)