fix(tui): skip question reject when dialog is open - #45306
Open
niho2 wants to merge 1 commit into
Open
Conversation
Guard ESC and app.exit handlers in QuestionPrompt to skip reject() when a dialog is currently open (dialog.stack.length > 0). This prevents the question from being rejected while the user is closing a dialog such as the model picker. Previously, pressing ESC with both a dialog and a pending question would fire both handlers simultaneously — closing the dialog and rejecting the question. The agent's execution was interrupted and the question disappeared. Fixes anomalyco#45304
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.
Fixes #45304
When a dialog is open (e.g. model picker) and the agent asks a question in the background, pressing ESC closes the dialog AND rejects the question simultaneously. The question disappears and the agent's execution is interrupted.
What changed
Guard the ESC and
app.exithandlers inQuestionPromptto skipreject()when a dialog is currently open (dialog.stack.length > 0). This prevents the question from being rejected while a dialog is being dismissed. Once the dialog is closed, ESC works normally to reject the question.How to verify
<leader>m)