fix(meeting-chat): don't send a cancelled answer back to the panel
Clearing the chat mid-answer emptied the panel and then the truncated answer reappeared, a turn the model's history never recorded.
This commit is contained in:
parent
95656b098a
commit
a14bb52b7f
2 changed files with 38 additions and 8 deletions
|
|
@ -1418,14 +1418,15 @@ ${excerpt.text}`
|
|||
this._sendToRenderer(IPC_CHANNELS.MEETING_CHAT.DELTA, { sessionId, token })
|
||||
}
|
||||
|
||||
if (!signal.aborted) {
|
||||
const updated = [
|
||||
...history,
|
||||
{ role: 'user' as const, content: userMessage },
|
||||
{ role: 'assistant' as const, content: fullResponse },
|
||||
]
|
||||
this._chatHistories.set(sessionId, updated.slice(-MAX_CHAT_HISTORY_MESSAGES))
|
||||
}
|
||||
// 취소(대화 지우기·패널 떠남·같은 회의의 새 질문)된 답변은 보내지 않는다 — 비운 대화에 잘린 답변이
|
||||
// 다시 나타났고, 기록에 없는 턴이라 화면과 모델의 대화가 어긋났다.
|
||||
if (signal.aborted) return
|
||||
const updated = [
|
||||
...history,
|
||||
{ role: 'user' as const, content: userMessage },
|
||||
{ role: 'assistant' as const, content: fullResponse },
|
||||
]
|
||||
this._chatHistories.set(sessionId, updated.slice(-MAX_CHAT_HISTORY_MESSAGES))
|
||||
this._sendToRenderer(IPC_CHANNELS.MEETING_CHAT.MESSAGE, {
|
||||
sessionId,
|
||||
role: 'assistant',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue