fix: consistent citation numbering during streaming

This commit is contained in:
CREDO23 2026-01-13 09:09:53 +02:00
parent cd3677b5fa
commit 5e31a228bc
2 changed files with 2 additions and 5 deletions

View file

@ -82,6 +82,7 @@ def format_mentioned_surfsense_docs_as_context(
context_parts.append( context_parts.append(
"The user has explicitly mentioned the following SurfSense documentation pages. " "The user has explicitly mentioned the following SurfSense documentation pages. "
"These are official documentation about how to use SurfSense and should be used to answer questions about the application. " "These are official documentation about how to use SurfSense and should be used to answer questions about the application. "
"Use [citation:CHUNK_ID] format for citations (e.g., [citation:doc-123])."
) )
for doc in documents: for doc in documents:

View file

@ -90,10 +90,6 @@ function parseTextWithCitations(text: string): ReactNode[] {
} }
const MarkdownTextImpl = () => { const MarkdownTextImpl = () => {
// Reset citation counter at the start of each render
// This ensures consistent numbering as the message streams in
resetCitationCounter();
return ( return (
<MarkdownTextPrimitive <MarkdownTextPrimitive
remarkPlugins={[remarkGfm]} remarkPlugins={[remarkGfm]}