-
Notifications
You must be signed in to change notification settings - Fork 31
feat(ui): add question tool support #177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add API client methods for question endpoints (list, reply, reject) - Add question event types (question.asked, question.replied, question.rejected) - Add question picker UI that shows full question as notification and uses short header as prompt to avoid truncation - Support single-select and multi-select questions with 'Other' option - Add question icon to icon presets - Wire up question.asked event handler in renderer This enables opencode.nvim to handle the mcp_question tool that allows the AI to ask users questions during execution.
- add support for multi-selection with confirmation action - introduce dynamic input handling for "Other" responses - refactor user feedback notifications for better context - utilize base_picker for streamlined option formatting and selection Closes sudo-tee#123
sudo-tee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great.
I didn't even know it was possible. Opencode moves so fast it's hard to follow.
I left a couple of notes about AI comments. I am not a fan of adding comments for obvious things.
I encountered an issue where if I hit escape after a question The plugin ends up in infinite Thinking...
A part from that code loooks clean
- add logic to ensure callbacks are invoked when selections are made - handle cases where selection is cancelled to call callback with nil - update multiple UI components (telescope, mini_pick, snacks) for consistency - improve user experience by managing selection states effectively
- clarify that comments should explain *why* something is done, not *what* - emphasize avoiding obvious comments that restate code functionality
Summary
Adds support for the
mcp_questiontool which allows the AI to ask users questions during execution. Previously, when OpenCode used the question tool, the UI would just hang.Changes
list_questions,reply_question,reject_question)question.asked,question.replied,question.rejected)question.askedevent handler in rendererHow it works
question.askedeventbase_pickervim.notifynotification (for visibility, may auto-dismiss)Bug fix
Fixed an issue in
base_pickerwhere Snacks picker wouldn't close after confirming a multi-select action. Custom actions now properly collect selected items before closing the picker.Features
vim.ui.input