Skip to content

fix(coding-agent): return to ask options after custom escape#3270

Open
roboomp wants to merge 1 commit into
mainfrom
farm/f6500cc6/fix-ask-other-escape
Open

fix(coding-agent): return to ask options after custom escape#3270
roboomp wants to merge 1 commit into
mainfrom
farm/f6500cc6/fix-ask-other-escape

Conversation

@roboomp

@roboomp roboomp commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

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 expected Other (type your own) followed by editor Escape to raise ToolAbortError("Ask tool was cancelled by the user").

Cause

packages/coding-agent/src/tools/ask.ts treated ui.editor(...) returning undefined as a completed empty answer path inside askSingleQuestion: single-question flows then aborted on empty selectedOptions/customInput, while multi-question flows auto-advanced with an empty result.

Fix

  • Keep askSingleQuestion on the current question when the custom editor is dismissed, for both single-select and multi-select prompts.
  • Preserve existing selections/custom input while re-showing the option list.
  • Update ask-tool regression tests for single-question, multi-question, and multi-select Escape-from-custom flows.
  • Add the coding-agent changelog entry for Can't return to options list in ask tool #3269.

Verification

bun --cwd=packages/coding-agent test test/tools/ask.test.ts passed: 35 tests, 155 assertions. gh_push_branch pre-publish gate passed before pushing. Fixes #3269

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
@github-actions github-actions Bot added the vouched Passed the vouch gate label Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vouched Passed the vouch gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't return to options list in ask tool

1 participant