Skip redundant send_to_terminal confirmation when replying to askQuestions carousel#309598
Merged
meganrogge merged 4 commits intorelease/1.116from Apr 14, 2026
Merged
Skip redundant send_to_terminal confirmation when replying to askQuestions carousel#309598meganrogge merged 4 commits intorelease/1.116from
send_to_terminal confirmation when replying to askQuestions carousel#309598meganrogge merged 4 commits intorelease/1.116from
Conversation
Collaborator
Author
|
closing as we're not doing candidates probably |
TylerLeonhardt
approved these changes
Apr 14, 2026
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 #309589
Fixes #309608
When an interactive command (e.g.
npm init) waits for input in default approvals mode, the agent callsaskQuestionsto collect user answers, then sends each answer viasend_to_terminal. Previously, asend_to_terminalcall could show a confirmation dialog, even though the user just explicitly provided that text through the askQuestions UI.This skips the confirmation when we can correlate the
send_to_terminaltext to a recently answered question carousel for the same terminal.Changes
Confirmation skip —
_getQuestionContextForTerminalalready returns the question text for the "(replying to: …)" display. A non-undefinedresult now also signals that confirmation is unnecessary.forceConfirmationReasonstill takes precedence, and autopilot mode behavior is unchanged.Exact answer matching — Previously,
_getQuestionContextForTerminalhad shortcuts that could return a question without verifying the command matched the answer (single-question shortcut, multi-question fallback). This meant anysend_to_terminalcall could bypass confirmation whenever a recent carousel existed for that terminal. Now the method only returns a question when the command exactly matches the answer at the correct position.Positional matching — When all answers are identical (e.g. pressing Enter to accept every default in
npm init), answer-value matching always returned the first question. The method now counts priorsend_to_terminaltool invocations after the carousel to determine the positional index, so the progress message correctly shows "Package name?" → "version?" → "description?" instead of repeating "Package name?" for every prompt.demo-prompt-input.mov