mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-11-12 21:12:44 -05:00
fix: Override file edit tool another assistant message
This commit is contained in:
@ -195,6 +195,10 @@ QJsonArray ChatModel::prepareMessagesForRequest(const QString &systemPrompt) con
|
||||
case ChatRole::Assistant:
|
||||
role = "assistant";
|
||||
break;
|
||||
case ChatRole::Tool:
|
||||
case ChatRole::FileEdit:
|
||||
// Skip Tool and FileEdit messages - they are UI-only
|
||||
continue;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user