Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lua/eca/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,15 @@ function M.setup()

vim.api.nvim_create_user_command("EcaStopResponse", function()
local eca = require("eca")
local chat = eca.get()
local Utils = require("eca.utils")

-- Force stop any ongoing streaming response
local chat_id = chat.mediator:id()
if chat_id then
chat.mediator:send("chat/promptStop", { chatId = chat_id }, nil)
end
Comment on lines 399 to +403

if eca.sidebar then
eca.sidebar:_finalize_streaming_response()
Comment on lines 399 to 406
Logger.notify("Forced stop of streaming response", vim.log.levels.INFO)
Expand Down
5 changes: 0 additions & 5 deletions lua/eca/sidebar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1721,11 +1721,6 @@ 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")

Expand Down
Loading