From a24fc8291bc1aeab2755b4bc18753f029f27e5fe Mon Sep 17 00:00:00 2001 From: balibabu Date: Mon, 29 Dec 2025 12:58:12 +0800 Subject: [PATCH] Fix: If there is an error message on the chat page, the subsequent message references will not display correctly. #12252 (#12283) ### What problem does this PR solve? Fix: If there is an error message on the chat page, the subsequent message references will not display correctly. #12252 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- web/src/components/markdown-content/index.tsx | 2 +- web/src/pages/next-chats/utils.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/web/src/components/markdown-content/index.tsx b/web/src/components/markdown-content/index.tsx index 518756f95..6e93bf134 100644 --- a/web/src/components/markdown-content/index.tsx +++ b/web/src/components/markdown-content/index.tsx @@ -213,7 +213,7 @@ const MarkdownContent = ({ return ( - + Fig. {chunkIndex + 1} diff --git a/web/src/pages/next-chats/utils.ts b/web/src/pages/next-chats/utils.ts index ab640b7ac..260bc5350 100644 --- a/web/src/pages/next-chats/utils.ts +++ b/web/src/pages/next-chats/utils.ts @@ -32,7 +32,10 @@ export const buildMessageItemReference = ( message: IMessage, ) => { const assistantMessages = conversation.message - ?.filter((x) => x.role === MessageType.Assistant) + ?.filter( + (x) => + x.role === MessageType.Assistant && !x.content.startsWith('**ERROR**:'), // Exclude error messages + ) .slice(1); const referenceIndex = assistantMessages.findIndex( (x) => x.id === message.id,