Add AskUserQuestion support to the TUI#13830
Conversation
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Overview
This PR extracts the AskUserQuestion session state into shared AI code and adds a stateful TUI ask-question card with option-selector integration, keybindings, rendering, and tests.
Concerns
- The TUI child view can be recreated repeatedly for mixed single-/multi-select payloads because
matches_actioncompares the session's sorted question order to the original action payload order. - Navigating away from a cleared
Othereditor can leave the previous free-text answer in the session because blank active text is filtered toNoneand then not saved. - This is a user-facing TUI change, but the PR description does not include accepted TUI visual evidence. Please attach a terminal transcript,
render_to_lines/TuiBuffer::to_linessnapshot diff, or./script/run-tuicapture demonstrating the flow end to end.
Verdict
Found: 0 critical, 3 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
|
|
||
| #[derive(Clone, Debug, Default, Eq, PartialEq)] | ||
| /// In-progress answer data for a single question while the user is editing. | ||
| pub struct QuestionDraft { |
There was a problem hiding this comment.
agent suggested factoring this out into a seperate file from the view, lmk if you agree with that logic
ed4c16c to
8fb7cf0
Compare
|
/oz-review |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds a shared AskUserQuestion session and wires an interactive AskUserQuestion card into the TUI, including option selection, Other text, navigation, skip-all, focus restoration, and completed summaries.
Concerns
- The option selector now ignores its existing selected-row signal outside ask-question cards, which regresses normal option selector rendering for committed selections.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| ) -> Box<dyn TuiElement> { | ||
| let disabled = row.disabled_reason.is_some(); | ||
| let label_style = if is_selected { | ||
| let is_selected = self.selected_ids.contains(&row.id); |
There was a problem hiding this comment.
is_selected argument with the question-only selected_ids set, which defaults empty for normal option selectors, so existing selectors stop styling their committed selection. Preserve the incoming selected state for non-question selectors, or OR it with self.selected_ids.contains(&row.id).
8fb7cf0 to
6c13f12
Compare
|
Addressed the latest selector-rendering review in 6c13f12. Outside ask-question cards, render_row now explicitly uses the existing selected-row signal; question cards continue to use selected_ids for multiselect state. Added normal_selector_selected_row_does_not_depend_on_question_selected_ids, which verifies the numeric prefix and label retain bold selected styling with empty question ids. Full warp_tui suite: 301/301 passed; both required clippy passes and formatting checks passed. |
|
/oz-review |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds interactive AskUserQuestion support to the headless TUI, including a shared questionnaire session, TUI question card, option-selector integration, focus restoration, and TUI/unit coverage. The attached TUI snapshot and run-tui transcript satisfy the repo's visual-evidence requirement for this user-facing TUI change. No security findings were identified, and the provided spec context says no approved/repository spec context was found.
Concerns
- Completed answer summaries can pair answers with the wrong question when question order differs between the session's normalized editing order and a finished result's action/API order.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| let mut content = TuiFlex::column(); | ||
| content.add_child(self.render_summary(&label, answered > 0, app)); | ||
| for (index, question) in self.session.questions().iter().enumerate() { | ||
| let answer = answers |
There was a problem hiding this comment.
question_id here instead of by vector index. AskUserQuestionSession::new sorts questions for editing, but finished results can preserve the original action/API order; with a mixed single-/multi-select payload, answers.get(index) can render an answer beside the wrong question.
Co-Authored-By: Oz <oz-agent@warp.dev>
6c13f12 to
6f03d83
Compare
|
/oz-review |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
Adds a shared AskUserQuestion session state machine and an interactive headless TUI card for answering agent questions, including option selection, custom Other answers, navigation, skip-all behavior, focus restoration, rendered summaries, and regression coverage.
Concerns
- No blocking correctness, security, or spec-alignment concerns found in the attached diff.
spec_context.mdwas empty, so there were no approved spec commitments to validate beyond the PR description.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz

Description
Adds an interactive
AskUserQuestiontool-call card to the headless TUI. The card shares the questionnaire state machine with the GUI, supports single-select, multiselect, numbered selection, custom “Other” responses, question navigation, and one-press Ctrl+C skip-all behavior. It also restores focus to the main input when the question action finishes and renders deterministic completed-answer summaries.The implementation is rebased as one commit on
harry/code-1822-tui-option-selector(PR #13716) and uses the refreshed generic editor/selector APIs.Linked Issue
Testing
./script/run-tuicargo nextest run -p warp_tui— 303 passedcargo nextest run -p ai ask_user_question_session— 17 passedcargo clippy --workspace --exclude warp_completer --all-targets --tests -- -D warningscargo clippy -p warp_completer --all-targets --tests -- -D warnings./script/format --check./script/check_no_inline_test_modulesgit diff --checkReview regressions:
Screenshots / Videos
Exact
TuiBuffer::to_lines()snapshot asserted byactive_card_matches_question_panel_structure:Authenticated real-PTY verification with
./script/run-tui:2selected and submitted Option B.1,3,Canary, Enter submitted Stable plusOther: Canary; text did not leak into the main input.warp-tuirunning.Agent Mode
Agent artifacts
CHANGELOG-IMPROVEMENT: Warp's TUI can now answer interactive agent questions, including multiple-choice and custom responses.
Co-Authored-By: Oz oz-agent@warp.dev