From 99e0f5aef489069ae2555f39fd78aa3de1afaff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Thu, 27 Aug 2026 01:07:35 -0300 Subject: [PATCH] AI Assistant Plugin: do not send empty assistant messages, this will break some APIs (it was accidental). --- src/tools/ecode/plugins/aiassistant/chatui.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tools/ecode/plugins/aiassistant/chatui.cpp b/src/tools/ecode/plugins/aiassistant/chatui.cpp index d95f3b32d..69f29d2dd 100644 --- a/src/tools/ecode/plugins/aiassistant/chatui.cpp +++ b/src/tools/ecode/plugins/aiassistant/chatui.cpp @@ -2365,6 +2365,8 @@ nlohmann::json LLMChatUI::chatToJson( bool forRequest ) { if ( !roleDDL || !editorNode || !editorNode->isType( UI_TYPE_CODEEDITOR ) ) continue; UICodeEditor* codeEditor = editorNode->asType(); + if ( codeEditor->getDocument().isEmpty() ) + continue; std::string role = LLMChat::roleToString( static_cast( roleDDL->getListBox()->getItemSelectedIndex() ) ); auto text = codeEditor->getDocument().toUtf8String();