[FEATURE]: RFC: add an "interject" answer to the "ask" permissions responses?
Feature hasn't been suggested before.
- [x] I have verified this feature I'm about to request hasn't been suggested before.
Add some sort of interjection response option to the user prompt used by the "ask" permission
Often, when I have a tool permission was set to "ask", I wish that one of the response options was something like "interject" (or maybe "interrupt" or "advise"? Something like that, I'm open on what to call it).
Often when I decide I don't want it using some tool or running some particular command, what I'd really prefer to be able do is have processing stop so I had the opportunity to interject and advise the model about what to do instead: "No, don't run that command, run this other command instead", "No, use this other more appropriate tool instead", that sort of thing.
I can imagine a couple of ways this could work:
Option 1. Simple: just stop processing and let the user type their interjection in the normal prompt input. Option 2. Slightly more complicated: prompt the user (with a popup window or something maybe?) and format the interjection into -the error that denying returns to the model.
Currently, when I deny a tool call, processing continues and the model will just make it's own decision about how to proceed. If I want to give it advice, the best I can do is choose deny and immediately start hammering the escape key. This isn't particularly ergonomic.
Do other folks agree with me that a response option like this would be useful? If so, do you have a preference between the above option 1 or option 2?
If people do like this idea, I'd be happy to take a stab at implementing it and submit a PR. Let me know what y'all think!
This issue might be a duplicate of existing issues. Please check:
- #3455: Make permissions dialog non-blocking and add modifier key shortcuts
- #4092: better navigation of output, alternative vim mode and non-blocking agent permission requests
- #3419: Add "Accept for Session" Option for Permission Prompts
These issues all relate to improving the permission workflow and user control when the "ask" permission is set. Feel free to ignore if your specific use case isn't addressed by these.
I also feel the weirdness, but isn't deny then prompt functionally equivalent?
The overall effect of deny-then-prompt is similar, but there are some drawbacks:
- It's less ergonomic, requiring at least 2 additional keystrokes (
d,<esc>,<esc>vs justi). - On any reasonably fast modern computer, when you hit deny, opencode likely begins the following request with the provider nearly instantly. When using a non-free provider/model, by the time my finger has moved to the escape key and struck it twice to cancel it, it's probably already cost me tokens/requests.
I think deny stops the loop. but to be fair a similar problem is that you can't type at all during a permission request. I really wish that were possible
Currently, deny does not stop the loop, the model is given an error message explaining to it that the tool use was denied and it then decides on it's own what it would like to do instead.
The feature described in this issue allows you to basically 'pause' the loop so that you can interject and offer your advice to the model on how it should proceed.
If you'd like to try it out, I've submitted a PR implementing this feature (PR#4844) earlier today. It's working well for me so far (I restricted a bunch of tool permissions I normally have on "allow" to "ask" just so I'd have more opportunities to test the feature out), but I'd love to hear some feedback from others, I invite you to try it out and let me know what you think, I'd love to hear how it works out for you.