fix: Override file edit tool another assistant message

This commit is contained in:
Petr Mironychev
2025-10-21 00:27:47 +02:00
parent 70c610997a
commit c95b20d6d4
2 changed files with 8 additions and 0 deletions

View File

@ -142,6 +142,10 @@ void ClientInterface::sendMessage(
QVector<LLMCore::Message> messages;
for (const auto &msg : m_chatModel->getChatHistory()) {
// Skip Tool and FileEdit messages - they are UI-only and should not be in API history
if (msg.role == ChatModel::ChatRole::Tool || msg.role == ChatModel::ChatRole::FileEdit) {
continue;
}
messages.append({msg.role == ChatModel::ChatRole::User ? "user" : "assistant", msg.content});
}
context.history = messages;