Skip to content

Commit fe1943f

Browse files
committed
Do not remove pending message upon Stop
We want to save the received data anyway. Abort will call finish and this will save the received data. Fixes: cristianadam#9
1 parent f7c4caa commit fe1943f

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

llamachatmanager.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,6 @@ void ChatManager::stopGenerating(const QString &convId)
491491
if (!m_pendingMessages.contains(convId))
492492
return;
493493

494-
m_pendingMessages.remove(convId);
495-
496494
if (m_abortControllers.contains(convId)) {
497495
auto controller = m_abortControllers.take(convId);
498496
controller->abort();
@@ -763,7 +761,7 @@ void ChatManager::sendChatRequest(const QString &convId,
763761
},
764762
[this, convId](const QString &err) {
765763
qCWarning(llamaChatNetwork) << "SSE stream error:" << err;
766-
m_pendingMessages.remove(convId);
764+
767765
if (m_abortControllers.contains(convId))
768766
m_abortControllers[convId]->deleteLater();
769767
});

0 commit comments

Comments
 (0)