When rejecting, stop the response and wait for user input
To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.
Similar to Claude Code, when I reject an edit or command I'd like to tell the bot why I'm rejecting it and what to do differently.
I believe we can support that, when we click reject we stop the LLM loop and wait for user type and send what to do next, so we send the tool call rejected + a new user message asking what to do.
FYI @bombaywalla since you are touching a code close to that. I will take a look how hard it is to support that, it should not be hard
If I understood this enhancement correctly, I think it is orthogonal to what I'm doing, though in a similar area in the case of rejecting a command with a reason. I think what we can do in that case is to add a new event and new transition with an additional action that would send the reason to the LLM. I don't believe a new state is needed
I'd prefer to wait on this until the cancellation issue I'm working on is completed.
I kind already did it hehe, it was pretty easy and I don't think it will affect your work!
Right. There should be no impact at all on the cancellation work.
Fixed on 0.58.0
Hi @ericdallo. Thanks for addressing this issue promptly.
I was looking at the code changes for this issue and noticed that there is a new call to finish-chat-prompt! if @any-rejected-tool-call* is true.
From what I can tell, it seems that finish-chat-prompt! will be called if any one of a collection of multiple concurrent calls is denied by the config or if the call is rejected by the user.
Is that intended behavior?
I ask because, previous to this change, if a tool call was rejected, finish-chat-prompt! was not called.
Yes @bombaywalla it was on purpose! If that case happens, we will save to chat history that we called a tool with success, and save that we called one which was rejected and finish chat, when user input the reason it was rejected, we would send both tools (with the error saying that it was rejected) + user input, so LLM will know what to do next