fix(coding-agent): return to ask options after custom escape#3270
Open
roboomp wants to merge 1 commit into
Open
fix(coding-agent): return to ask options after custom escape#3270roboomp wants to merge 1 commit into
roboomp wants to merge 1 commit into
Conversation
Keep the ask tool on the current question when the custom answer editor is dismissed, so Escape from Other returns to the option selector instead of aborting or recording an empty answer. Fixes #3269
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.
Repro
Running
bun --cwd=packages/coding-agent test test/tools/ask.test.ts -t "aborts when editor is cancelled in single-question flow"reproduced the reported behavior: the existing test expectedOther (type your own)followed by editor Escape to raiseToolAbortError("Ask tool was cancelled by the user").Cause
packages/coding-agent/src/tools/ask.tstreatedui.editor(...)returningundefinedas a completed empty answer path insideaskSingleQuestion: single-question flows then aborted on emptyselectedOptions/customInput, while multi-question flows auto-advanced with an empty result.Fix
askSingleQuestionon the current question when the custom editor is dismissed, for both single-select and multi-select prompts.asktool #3269.Verification
bun --cwd=packages/coding-agent test test/tools/ask.test.tspassed: 35 tests, 155 assertions.gh_push_branchpre-publish gate passed before pushing. Fixes #3269