diff --git a/tools/server/webui/src/lib/components/app/content/MarkdownContent.svelte b/tools/server/webui/src/lib/components/app/content/MarkdownContent.svelte index 48196d96e6..ee3e957283 100644 --- a/tools/server/webui/src/lib/components/app/content/MarkdownContent.svelte +++ b/tools/server/webui/src/lib/components/app/content/MarkdownContent.svelte @@ -61,7 +61,8 @@ let pendingMarkdown: string | null = null; let isProcessing = false; - // Incremental parsing cache, avoids re-transforming stable blocks + // Per-instance transform cache, avoids re-transforming stable blocks during streaming + // Garbage collected when component is destroyed (on conversation change) const transformCache = new SvelteMap(); let previousContent = ''; @@ -237,12 +238,6 @@ transformCache.set(hash, html); - // Limit cache size (generous limit for 200K token contexts) - if (transformCache.size > 5000) { - const keysToDelete = Array.from(transformCache.keys()).slice(0, 1000); - keysToDelete.forEach((k) => transformCache.delete(k)); - } - return { html, hash }; }