GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat(new tool):Adding a new tool to opencode -> askquestion tool by iljod · Pull Request #5958 · anomalyco/opencode Conversation
|
|
this is what it looks like in practice |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
any & all suggestions welcome, because I would love for this to get merged into the real codebase 🫡 btw also resolves #5960 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
- Memory Leak: Call AskQuestion.cleanup when a session is removed. - Race Condition: Refactor fragile metadata polling in SessionPrompt with a recursive style-guide compliant pattern. - Performance: Optimize TUI sync by scanning messages and parts backwards. - UX Deadlock: Fix Enter key behavior to correctly submit custom text on the final question. - Shortcuts: Support keyboard shortcuts 1-8 for all possible question options. - Docs: Update askquestion.txt to reflect actual limits (1-8 questions, 2-8 options). - Refactor: Flatten DialogAskQuestion logic with early returns to meet project conventions.
|
Can I say a fantastic addition if it gets merged! The only issue I see here is that it seems to be tied to the TUI. So it would need to be added to the web as well as the desktop app. If it gets merged like this what would happen for desktop app users if the tool gets triggered? Can any custom client render their own UI based on the current implementation? I have yet to see the code itself, but these are the first questions that come to mind |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
thanks for the feedback & the love! yea I 100% forgot the desktop app & the webui, the current implementation makes it really easy for other to tack stuff unto it -> fetch('/askquestion/respond', ...) etc I'm not really that good at webdev for the website, so any other help would be welcome!!! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@rekram1-node |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
This is looking great!! Last week i tried to solve the same thing with a different approach: My main goal posting here is not to compete with this PR by any means but just to add context on using a different approach, this PR is more similar to Claude Code, the other PR uses TUI and Dialog, which feels more unique to OpenCode design model. Either way, i'm more excited about the feature than the implementation, so either works for me 😄 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…malyco#5563) This merges the askquestion tool from upstream which: - Allows AI to pause and solicit structured feedback via TUI wizard - Supports single-select, multi-select, and confirm dialog types - Fixes race conditions from the previous Ask Tool implementation (PR anomalyco#5563) - Uses exponential backoff polling for state synchronization Merged fork features preserved: - Layout density system for small terminals - Spinner style customization - Bash output full-screen viewer - Search in messages (Ctrl+/) - Sidebar resize - All other fork-specific enhancements Also updated fork-features.json and README.md to reference PR anomalyco#5958 instead of anomalyco#5563.
|
This is really nice, and works perfectly fine. I would restrict it to the primary agents only. You can update the task tool call in the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
What's the difference from just asking the model to propose questions in numbered list one question at a time? Does this tool mean that we minimise requests? Otherwise it's not different. Also I really think this kind of thing should wait until plugins can create their own UI elements. relevant: #5563 (comment) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Thank you! I also really like your implementation! I just made it similar to Claude's since I like to see all the chat history when answering the questions, but just like you I love the implementation more then who makes it haha |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
- CLI TUI sends x-opencode-client: tui header - Web/Desktop apps don't send this header (defaults to "web") - Server passes client type through prompt system - askquestion tool is only provided to TUI clients
The askquestion tool is specifically designed for the planning phase, it pauses execution and presents a wizard UI so the AI can gather requirements before starting work, rather than guessing or making assumptions that lead to costly corrections. (token wise, and code debt wise), and this would encourage better system usage & token usage for most users who don't ask questions With the tool, execution pauses while the user answers all questions in the wizard, then the AI proceeds with complete context. Without it, the AI would need to:
This actually reduces hallucinations and wasted tokens because the AI gets clear requirements upfront instead of trying to infer them. Totally agree this would be better long-term for ui plugins! The askquestion tool is intentionally minimal and backward-compatible while the team figures out how plugin-defined UI widgets would work in the client-server architecture. It can coexist with a proper plugin UI system down the line. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@rekram1-node could you perhaps review this? And then I'd make any changes you want :)) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The ask tool used Bus events that never reached the tool's subscription due to Instance.state scoping issues. The askquestion tool (upstream PR anomalyco#5958) uses HTTP endpoints and works correctly. Removed: - ask tool registration and implementation - Question namespace schemas - DialogQuestion UI components - TuiEvent.QuestionRequest/Response event types - ask.test.ts tests Updated plan.txt to reference askquestion instead of ask.
Right but I ask again... what's the difference between asking my model to just give me the questions it wants to me as a numbered list, asking the questions one by one? I can't really see any difference tbh. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I like the concept but we also need to consider how other clients besides the TUI will be able to handle these tool calls. Currently in the web/desktop client, when the askquestion tool is called, the session just hangs and has to be resumed from the tui |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I think what both of these PRs lack to express. Is where this should be going. The way I see it they shouldn't be thought of as a forms. But the end goal here is something like Generative-TUI. What starts as form could become a library of TUI components that would allow the models to render certain information beyond text. I still do not see this as a core feature into OpenCode yet, we probably should add that as a plugin first. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
it's not something i would personally need but it's a core feature in claude code plan mode, so a lot of new-comers have requested it and i think it would help with adoption for that reason alone |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I'm one of them. This feature is very helpful in Claude Code and I will be very glad to see it in OpenCode. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Resolved conflicts by keeping fork-specific features: - PR anomalyco#5968 small screen styling (reverted upstream, preserved here) - Search in messages (PR anomalyco#4898) - Draggable sidebar resize (PR anomalyco#5917) - AskQuestion tool (PR anomalyco#5958) - IDE integration - Bash output viewer with ANSI (PR anomalyco#4791) - Mobile PWA support - Share infrastructure for shuv.ai Merged upstream improvements: - review.toggle command with mod+shift+r keybind - Title tag for share pages - Session navigation and sorting improvements - Various docs and CI updates - Provider updates (Cloudflare AI Gateway) - MCP tools/list_changed notifications - Prompt stashing feature - Did you know tips on start screen
|
Hi guys, great feature thank you! I was testing this PR locally and I noticed that if I have text inserted but not sent, in plan mode. When askquestiontool is triggered - I lose all text in the textbox that I was working on. Small detail, but can be quite frustrating if I am queuing up the next message (possibly waiting for the current work to finish before I hit enter). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
It's purely DX. It's one of the best features added to Claude Code IMO, because it allows you to quickly select different options (which would require a good bit of typing otherwise). When I'm running a plan and I have the agent ask me questions, it helps to be able to pick between two options or provide a nice "explainer" for the agent if the options it provided aren't quite good enough. Are you asking why people would want this? If so, that's your answer. It's a highly regarded feature of Claude Code. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
This is such a killer feature in Claude Code and as my "Holiday Gifted 2xLimits" ran out I'm looking for alternatives, so far opencode looks like a good fit. But I use To the people who repeatedly ask how this is different from going into different turns with the LLM to answer questions: Try out claude code first and come back! As I just highlighted, the ability to pick an answer, tab to the next question, realise that this question provides another angle the LLM already thought off that I didn't and go back to the previous tab to adjust my answer is JUST ONE OF MANY examples where having this tool for the LLM is vastly superior! Not only that, but read also Anthropic and Cloudflare papers on the problem with MCP tool calls (passing the conversation back and forth between user and LLM repeatedly) versus having a single call resolve multiple questions and sending those answers back in one turn! It's so much faster, keeps the interaction snappy and honestly shows why CC is leading other Agent Shells by far. Until this feature is in OpenCode, I'm afraid I will have to stay with Claude Code! OpenCode is super promising and I'm happy I gave it try this holiday season! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
I think this kind of thinking is a logical fallacy. Appeal to authority I think it is. I can see why lots of people would like it. I don't understand why it needs to be in core. How do I disable it? If everything goes in core then we're back in the box of poorly named booleans to disable things. The plugin system already enables this... That's already a feature flag system. I 💯 encourage all ideas, just not in core. The only thing in core I'm enthusiastic about is things that expand the capability of what plugins can do (in a way that is uniform across all three modes) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
no it doesn't, but with #6330 it might anyone reading this discussion would appreciate the design proposal there to ensure plugins can provide |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Glad you see my point. The plugin system is open codes strength above all the others. If I don't want this I simply didn't install the plugin |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I can already do this without this pr though. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
and can you at least try to see ours too? Thanks, I think we can close this thread as mentioned the proposal to add plugin support for this type of feature is promising |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Not really. I don't think this UI feature needs to be rushed into core. Biggest issue I have is that I can already get this feature without a UI implementation with much richer and more flexible interaction.
That isn't how github works.
@so0k It'd be great if you could link to this information. you seem to be indicating that this particular PR does something to reduce the amount of LLM requests? Questions I have around this kind of UI feature is:
But overall: Any of these approaches just makes me feel:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
hey thanks for taking a swing at this - this is one of our most requested features so we will be adding this functionality given that it'll be one of the most complex UX interactions in the product we'll need to look at it from scratch - hopefully next week! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sure - Anthropic Blog Post - Section on Intermediate Result Token consumption |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
yeah that's not what I meant, we all agree the proposal I linked seems like the way to go |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
thanks so much for looking at my implementation & going ahead on implementing the askquestion tool <3 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@iljod May I ask why is this PR closed? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ah I see. That's nice |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
- Restore double Ctrl+C to exit with toast warning (PR anomalyco#4900) - Restore AskQuestion dialog and integration (PR anomalyco#5958) - Restore search in messages feature (PR anomalyco#4898) - Restore live token usage during streaming (PR anomalyco#4709) - Restore sidebar resize drag feature (PR anomalyco#5917) - Restore spinner customization features - Restore ANSI terminal emulation for bash output (PR anomalyco#4791) - Restore header visibility toggle - Restore goToParent() for subagent navigation The rerere auto-resolution incorrectly merged some files, removing fork-specific features that were previously added.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[FEATURE]: Plan mode questions like claude code
There was an error while loading. Please reload this page.