Skip to content

Build your personal knowledge base with Trilium Notes

fix(llm): prevent sent message duplication

perf3ctaad92b57c783
diff --git a/apps/server/src/routes/api/llm.ts b/apps/server/src/routes/api/llm.ts
index 80bc368844..05e8ee8794 100644
--- a/apps/server/src/routes/api/llm.ts
+++ b/apps/server/src/routes/api/llm.ts
@@ -858,15 +858,6 @@ async function streamMessage(req: Request, res: Response) {
}
}
- // Add user message to the chat (without timestamp since Message interface doesn't support it)
- chat.messages.push({
- role: 'user',
- content: enhancedContent
- });
-
- // Save the updated chat
- await chatStorageService.updateChat(chat.id, chat.messages, chat.title);
-
// Create request parameters for the pipeline
const requestParams = {
chatNoteId: chatNoteId,