AI Assistant Plugin: do not send empty assistant messages, this will break some APIs (it was accidental).

This commit is contained in:
Martín Lucas Golini
2026-08-27 01:07:35 -03:00
parent 7f6568cfb0
commit 99e0f5aef4
@@ -2365,6 +2365,8 @@ nlohmann::json LLMChatUI::chatToJson( bool forRequest ) {
if ( !roleDDL || !editorNode || !editorNode->isType( UI_TYPE_CODEEDITOR ) )
continue;
UICodeEditor* codeEditor = editorNode->asType<UICodeEditor>();
if ( codeEditor->getDocument().isEmpty() )
continue;
std::string role = LLMChat::roleToString(
static_cast<LLMChat::Role>( roleDDL->getListBox()->getItemSelectedIndex() ) );
auto text = codeEditor->getDocument().toUtf8String();