fix: Improve tool handler tools execution

This commit is contained in:
Petr Mironychev
2025-10-12 11:18:20 +02:00
parent 5ae6f9e3bf
commit d285ab6117
2 changed files with 8 additions and 4 deletions

View File

@ -86,8 +86,12 @@ QJsonArray ToolsManager::getToolsDefinitions(LLMCore::ToolSchemaFormat format) c
void ToolsManager::cleanupRequest(const QString &requestId)
{
m_pendingTools.remove(requestId);
m_toolHandler->cleanupRequest(requestId);
if (m_pendingTools.contains(requestId)) {
LOG_MESSAGE(QString("ToolsManager: Canceling pending tools for request %1").arg(requestId));
m_toolHandler->cleanupRequest(requestId);
m_pendingTools.remove(requestId);
}
LOG_MESSAGE(QString("ToolsManager: Cleaned up request %1").arg(requestId));
}