mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-25 07:00:48 +09:00
7de55f6b49
When messages like [assistant(tool_calls), tool, assistant(text)] are merged into a single ChatMessage by convertMessagesToChats, the merged message uses the first assistant's ID. The SSE /messages/events backlog (which uses >= for the since filter) could re-deliver the final assistant message, and hasMessageWithId failed to recognize it because the merged ID was different. This caused the last assistant message to appear twice after a page refresh. Track all original server message IDs in a Set (knownServerMessageIds) so that hasMessageWithId can catch messages whose IDs were absorbed during merging.