From 0287e83642eab2b3e24dd1e2ac232be65d01ad58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Wed, 19 Aug 2026 01:31:51 -0300 Subject: [PATCH] Damn, missed the latests changes: Fix ACP Agent mode message chunks enqueue ordering issue (ACP thought chunks were enqueued twice while answer chunks were enqueued once). --- src/tools/ecode/plugins/aiassistant/chatui.cpp | 8 +++++--- src/tools/ecode/plugins/aiassistant/chatui.hpp | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/tools/ecode/plugins/aiassistant/chatui.cpp b/src/tools/ecode/plugins/aiassistant/chatui.cpp index 81e760035..d95f3b32d 100644 --- a/src/tools/ecode/plugins/aiassistant/chatui.cpp +++ b/src/tools/ecode/plugins/aiassistant/chatui.cpp @@ -1965,6 +1965,9 @@ void LLMChatUI::writeToLastChat( const std::string& text ) { void LLMChatUI::updateAgentModeUI() { mModelBtn->setVisible( !mIsAgentMode ); + mReasoningEffort->setVisible( !mIsAgentMode && mCurModel.reasoningConfiguration && + mCurModel.reasoningConfiguration->type != + LLMReasoningType::None ); mAgentBtn->setVisible( mIsAgentMode ); mAgentConfigBtn->setVisible( mIsAgentMode ); mChatAdd->setVisible( !mIsAgentMode ); @@ -2001,7 +2004,6 @@ void LLMChatUI::setupAgentSession() { auto sessionUpdate = msg.value( "sessionUpdate", "" ); if ( sessionUpdate == "agent_message_chunk" ) { if ( msg.contains( "content" ) && msg["content"].contains( "text" ) ) { - mThinkingBubble = nullptr; // Reset thinking bubble so next thought gets a new one auto chunk = msg["content"].value( "text", "" ); if ( !chunk.empty() ) writeToLastChat( chunk ); @@ -2010,7 +2012,7 @@ void LLMChatUI::setupAgentSession() { if ( msg.contains( "content" ) && msg["content"].contains( "text" ) ) { auto chunk = msg["content"].value( "text", "" ); if ( !chunk.empty() ) - runOnMainThread( [this, chunk] { updateThinkingBubble( chunk ); } ); + updateThinkingBubble( std::move( chunk ) ); } } else if ( sessionUpdate == "tool_call" || sessionUpdate == "tool_call_update" ) { addToolCallUpdate( msg ); @@ -3056,7 +3058,7 @@ void LLMChatUI::addToolCallUpdate( const nlohmann::json& msg ) { } ); } -void LLMChatUI::updateThinkingBubble( const std::string& chunk ) { +void LLMChatUI::updateThinkingBubble( std::string chunk ) { if ( chunk.empty() ) return; diff --git a/src/tools/ecode/plugins/aiassistant/chatui.hpp b/src/tools/ecode/plugins/aiassistant/chatui.hpp index a4cc54658..fb6fe4360 100644 --- a/src/tools/ecode/plugins/aiassistant/chatui.hpp +++ b/src/tools/ecode/plugins/aiassistant/chatui.hpp @@ -212,7 +212,7 @@ class LLMChatUI : public UILinearLayout, public WidgetCommandExecuter { void addThinkingBubble(); - void updateThinkingBubble( const std::string& chunk ); + void updateThinkingBubble( std::string chunk ); void addPermissionUI( const acp::RequestPermissionRequest& req, std::function cb );