From bcf9507512593ed6fc4611cece73da79163e2ba0 Mon Sep 17 00:00:00 2001 From: sam-shakeybridge-software <3429163+ssjoleary@users.noreply.github.com> Date: Fri, 17 Apr 2026 11:51:56 +0100 Subject: [PATCH] feat: send chat/promptStop to server on EcaStopResponse Previously :EcaStopResponse only finalized the local streaming UI without notifying the server. The server kept generating, silently burning tokens. Now sends chat/promptStop notification before cleanup. Co-Authored-By: Claude Opus 4.6 (1M context) --- lua/eca/sidebar.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/eca/sidebar.lua b/lua/eca/sidebar.lua index 142790b..a3a32c5 100644 --- a/lua/eca/sidebar.lua +++ b/lua/eca/sidebar.lua @@ -1716,6 +1716,11 @@ function M:_add_message(role, content) end function M:_finalize_streaming_response() if self._is_streaming then + local chat_id = self.mediator:id() + if chat_id then + self.mediator:send("chat/promptStop", { chatId = chat_id }, nil) + end + Logger.debug("DEBUG: Finalizing streaming response") Logger.debug("DEBUG: Final buffer had " .. #(self._current_response_buffer or "") .. " chars")