fix: Cleanup accumulated text in one request

This commit is contained in:
Petr Mironychev
2025-10-10 16:45:23 +02:00
parent 84770abb20
commit ebd71daf3d
9 changed files with 41 additions and 4 deletions

View File

@ -196,9 +196,7 @@ LLMCore::ProviderID ClaudeProvider::providerID() const
void ClaudeProvider::sendRequest(
const LLMCore::RequestID &requestId, const QUrl &url, const QJsonObject &payload)
{
if (m_dataBuffers.contains(requestId)) {
m_dataBuffers[requestId].responseContent.clear();
} else {
if (!m_messages.contains(requestId)) {
m_dataBuffers[requestId].clear();
}
@ -340,6 +338,7 @@ void ClaudeProvider::processStreamEvent(const QString &requestId, const QJsonObj
if (eventType == "message_start") {
message->startNewContinuation();
emit continuationStarted(requestId);
LOG_MESSAGE(QString("Starting NEW continuation for request %1").arg(requestId));
} else if (eventType == "content_block_start") {