Skip to content

Only stop prompt on explicit stop command#67

Merged
ericdallo merged 1 commit intoeditor-code-assistant:mainfrom
siemensikkema:only-stop-prompt-on-explicit-stop-command
Apr 24, 2026
Merged

Only stop prompt on explicit stop command#67
ericdallo merged 1 commit intoeditor-code-assistant:mainfrom
siemensikkema:only-stop-prompt-on-explicit-stop-command

Conversation

@siemensikkema
Copy link
Copy Markdown

Fixes “Prompt stopped” on toolCallPrepare and other unwanted events introduced in #63. This moves the “chat/promptStop” instruction inside the “EcaStopResponse” instead of the shared _finalize_streaming_response function.

Copilot AI review requested due to automatic review settings April 24, 2026 09:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts how the Neovim client notifies the server to stop generation so that chat/promptStop is only sent on the explicit stop command, avoiding unintended stops triggered by internal UI finalization events.

Changes:

  • Removed the chat/promptStop send from Sidebar:_finalize_streaming_response() to prevent stops on non-stop events (e.g., toolCallPrepare).
  • Added chat/promptStop send to the :EcaStopResponse user command so stopping is explicit.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
lua/eca/sidebar.lua Removes server stop notification from shared streaming finalization logic.
lua/eca/commands.lua Sends chat/promptStop as part of :EcaStopResponse instead of during generic finalize.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lua/eca/commands.lua
Comment on lines 399 to 406
-- 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

if eca.sidebar then
eca.sidebar:_finalize_streaming_response()
Comment thread lua/eca/commands.lua
vim.api.nvim_create_user_command("EcaStopResponse", function()
local eca = require("eca")
local chat = eca.get()
local Utils = require("eca.utils")
Comment thread lua/eca/commands.lua
Comment on lines 399 to +403
-- 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
@ericdallo
Copy link
Copy Markdown
Member

Thank you!
merging this but letting you know @ssjoleary

@ericdallo ericdallo merged commit 0e0dbe9 into editor-code-assistant:main Apr 24, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants