feat(tool): add ask-user-questions tool#2579
Conversation
45f7375 to
e873d22
Compare
…vice req/res JSON
e873d22 to
9b7248e
Compare
| } | ||
|
|
||
| func (w *ClientWorkspace) QuestionsAnswer(res questions.QuestionsResponse) { | ||
| // TODO Implement for ClientWorkspace. |
There was a problem hiding this comment.
For this I might need some help, as I don't know exactly what this is.
I haven't used Crush in client/server mode yet.
internal/ask_question service to the appask_user_questions tool
| providerInfo = string(m.prov.Name) | ||
| providerInfo = m.prov.Name | ||
| } | ||
| styles := ListItemStyles{ | ||
| miStyles := ListItemStyles{ | ||
| ItemBlurred: m.t.Dialog.NormalItem, | ||
| ItemFocused: m.t.Dialog.SelectedItem, | ||
| InfoTextBlurred: m.t.Base, | ||
| InfoTextFocused: m.t.Base, | ||
| } | ||
| return renderItem(styles, m.model.Name, providerInfo, m.focused, width, m.cache, &m.m) |
There was a problem hiding this comment.
Just a nitpick spotted by IntelliJ while I was reading the code.
ask_user_questions toolask_user_questions tool
ask_user_questions toolask-user-questions tool
|
Hi @detro, Great work on this PR! I had a quick thought/suggestion: do you think it would be a good idea to always append a "Type your own answer" option (perhaps triggering a textbox) alongside the predefined options the LLM provides? That way, if the user doesn't quite agree with any of the LLM's suggested choices, they always have a fallback to easily provide a custom answer. Of course, this is just an idea and only makes sense if it doesn't drastically increase the complexity of your current implementation. |
|
@Jonathan-79 thank you - yes, I think I want to expand the set of options a bit to offer that functionality. In fact, I think I'd like to imitate https://geminicli.com/docs/tools/ask-user/ and then describe to the LLM the the markdown that "in case the user should choose an 'other' option, call this tool again with the This leaves the choice to llm, depending on the context: when it makes sense to offer an "other" and when it doesn't. I have raised this even in a discord thread. |
With recent attention to Claude Code leak, I spent a bit of time into this analysis of the codebase, and I spotted something I have always wondered how it worked:
AskUserQuestionsystem tool. Something very similar exists in OpenCode too. And in Gemini CLI.When an LLM is in the Agent loop, sometimes I wish it stopped, it asked for my preference and then continued. Sometimes can be the small things, like
So I though I'd try to implement this tool in Crush.
The implementation is made essentially of 3 parts:
Questionsservice that uses PubSub to listen to Ask calls and handle Answer callsQuestionsdialog that knows how to render a consistently-styled form (or forms, if the LLM asks more than 1 question) and allow for single and multi selectionAskUserQuestionstool: frankly,fantasyfeels kinda magic to me - this was TOO EASY to implementCONTRIBUTING.md.Screenshots