fix(tui): allow session interrupt (ESC) when dialog is open#27917
Open
ranxianglei wants to merge 1 commit into
Open
fix(tui): allow session interrupt (ESC) when dialog is open#27917ranxianglei wants to merge 1 commit into
ranxianglei wants to merge 1 commit into
Conversation
When a permission dialog or other dialog is open, all keybindings including session_interrupt were disabled by the command palette matcher. This trapped users in an infinite dialog loop: dismiss dialog -> model retries tool -> new dialog opens. Split session.interrupt into its own useBindings call without the dialog guard, and remove the input.focused check in the handler so ESC works even when the input is blurred by a dialog. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Potential Related PR Found:
No complete duplicates found. PR #27917 appears to be addressing a unique root cause that other PRs haven't tackled. |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #27922
Type of change
What does this PR do?
When a permission dialog (or any dialog) is open in the TUI, the
session_interruptkeybind (double ESC) is completely blocked becausedialog.stack.length > 0disables all keybindings. This creates an infinite dialog loop where the user can only dismiss one dialog at a time while the model keeps retrying.Two changes in
component/prompt/index.tsx:Split
session.interruptinto its ownuseBindingscall without theenabled: command.matcherguard, so it's always reachable regardless of dialog state.Remove the
if (!input.focused) returncheck from the interrupt handler, so it works even when the prompt input is blurred by an open dialog.These are minimal changes — all other keybinds remain correctly blocked when dialogs are open. Only
session.interruptis exempted.How did you verify your code works?
This fix has been running in our fork (based on v1.14.41) for several days. Verified that:
Checklist