Skip to content

Skip redundant send_to_terminal confirmation when replying to askQuestions carousel#309598

Merged
meganrogge merged 4 commits intorelease/1.116from
merogge/candy-confirm
Apr 14, 2026
Merged

Skip redundant send_to_terminal confirmation when replying to askQuestions carousel#309598
meganrogge merged 4 commits intorelease/1.116from
merogge/candy-confirm

Conversation

@meganrogge
Copy link
Copy Markdown
Collaborator

@meganrogge meganrogge commented Apr 13, 2026

Fixes #309589
Fixes #309608

When an interactive command (e.g. npm init) waits for input in default approvals mode, the agent calls askQuestions to collect user answers, then sends each answer via send_to_terminal. Previously, a send_to_terminal call 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_terminal text to a recently answered question carousel for the same terminal.

Changes

Confirmation skip_getQuestionContextForTerminal already returns the question text for the "(replying to: …)" display. A non-undefined result now also signals that confirmation is unnecessary. forceConfirmationReason still takes precedence, and autopilot mode behavior is unchanged.

Exact answer matching — Previously, _getQuestionContextForTerminal had shortcuts that could return a question without verifying the command matched the answer (single-question shortcut, multi-question fallback). This meant any send_to_terminal call 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 prior send_to_terminal tool 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

@meganrogge meganrogge self-assigned this Apr 13, 2026
@meganrogge meganrogge added this to the 1.116.0 milestone Apr 13, 2026
@meganrogge meganrogge marked this pull request as draft April 13, 2026 19:57
@meganrogge
Copy link
Copy Markdown
Collaborator Author

closing as we're not doing candidates probably

@meganrogge meganrogge closed this Apr 14, 2026
@meganrogge meganrogge reopened this Apr 14, 2026
@meganrogge meganrogge enabled auto-merge (squash) April 14, 2026 18:51
@meganrogge meganrogge merged commit 73bf4de into release/1.116 Apr 14, 2026
26 checks passed
@meganrogge meganrogge deleted the merogge/candy-confirm branch April 14, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants