fix(web): 修复普通流式发送时用户消息延迟显示

在 legacy 流式发送路径中补齐本地乐观用户消息,避免消息发送后等待历史刷新才出现在对话中。
This commit is contained in:
Wenjie Zhang 2026-05-10 18:39:36 +08:00
parent a031cf0b56
commit f87b763b7b

View File

@ -1412,6 +1412,12 @@ const handleSendMessage = async ({ image } = {}) => {
threadState.isStreaming = true
resetOnGoingConv(threadId)
const requestId = createClientRequestId()
insertOptimisticHumanMessage(threadState, {
requestId,
text,
imageContent
})
threadState.streamAbortController = new AbortController()
try {