This commit is contained in:
2026-06-20 19:16:44 +08:00
parent db3d030169
commit dbb87823e8
26 changed files with 676 additions and 115 deletions
@@ -114,6 +114,14 @@ export function useConversationSession() {
const id = streamingMessageId.value
if (id == null) return
await chatApi.cancelMessage(id)
// 取消会 abort SSE,后端不再下发 done/error/message_meta 终止事件,
// 故须在此手动收尾(对齐 done/error/onError 路径):将仍处于 pending 的
// 助手消息置为终态 'cancelled',并清空 streamingMessageId 解除 isStreaming。
const msg = messages.value.find((m) => m.id === id)
if (msg && msg.status === 'pending') {
msg.status = 'cancelled'
}
streamingMessageId.value = null
detachStream()
}