Repository navigation
fix(native-chat): let a multi-question ask record list its questions - #23451
Conversation
A cancelled or pending structured ask with several questions showed only "Asked: 2 questions", and its questions appeared nowhere in the transcript. The row's subject now carries the question texts instead of a count, and the row unfolds them as a list below its toggle unless the record already lists them with their answers.
There was a problem hiding this comment.
ℹ️ No critical issues — one minor suggestion inline.
Reviewed changes
- Grouped asks now carry their question texts —
NativeChatAskRowSubject's{ kind: 'count'; count }becomes{ kind: 'questions'; questions: string[] }, and the row derives its "N questions" label fromquestions.length(src/shared/native-chat-ask-row.ts). - The awaiting row can list a grouped prompt — a new
listsQuestionsprop (defaulttrue) gates a numbered<ol>below the toggle and makes the count line togglable without a clipping measurement (NativeChatAwaitingInputRow.tsx). - Callers opt out where the questions are already shown — the receipt passes
listsQuestions={answers.length === 0}so cancelled/pending groups expand while resolved groups stay plain;NativeChatToolRunpassesfalseto keep the tool-run line count-only (NativeChatResolutionReceipt.tsx,NativeChatToolRun.tsx). - Tests — new grouped-prompt receipt cases (cancelled list, copy-outside-button, remount-open, fold-keeps-focus; pending list; resolved stays plain) plus updated shared subject assertions.
I traced every consumer of NativeChatAskRowSubject / nativeChatAskRunSubject; the only production callers are the two components updated here, and the subject is computed at draw time so nothing persisted or sent changes shape.
ℹ️ Nitpicks
- The JSDoc on
NativeChatAwaitingInputRow(lines 23-26) still says a grouped prompt becomes a disclosure unconditionally. With the newlistsQuestionsopt-out that is only true for callers that leave ittrue; a clause noting the opt-out would keep the comment honest.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| {questions.map((entry) => ( | ||
| <li key={entry} className="whitespace-pre-wrap break-words"> | ||
| {entry} | ||
| </li> |
There was a problem hiding this comment.
The question text is used as the React key, so a prompt that repeats a question produces duplicate keys — React warns and reconciles the duplicates unpredictably. The list is static, so an index key is unique and matches the existing pattern (NativeChatQuestionCard.tsx:166).
| {questions.map((entry) => ( | |
| <li key={entry} className="whitespace-pre-wrap break-words"> | |
| {entry} | |
| </li> | |
| {questions.map((entry, index) => ( | |
| <li key={index} className="whitespace-pre-wrap break-words"> | |
| {entry} | |
| </li> |
…stion A pending Codex group is keyed by its first question, which becomes its own row once answered. Opening the list left that row expanded, and folding it could drop the toggle under the pointer. The list and a lone question now remember their open state separately.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughGrouped-question subjects now contain the individual question texts rather than only a count. Awaiting-input rows can show the count and expand to an ordered question list. Receipt and tool-run callers control whether the row lists grouped questions. Tests cover pending, cancelled, and resolved grouped prompts, plus a cancelled single question. Priority: ⬇️ Low Priority: ⬇️ Low Priority: ⬇️ Low Priority: ⬇️ Low Estimated code review effort: Merge Risk: ⚪ Minimal · up to The grouped-question display change is mergeable after normal checks; no additional blocking issue is established. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Readers of a native-chat transcript can now expand unanswered or cancelled grouped prompts to see their questions. The change appears confined to display behavior, with no identified new privilege or execution path. The origin and access controls for the underlying transcript were not fully established. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- A grouped prompt's list no longer leaks its open state onto a lone question —
NativeChatAwaitingInputRownow builds its disclosure key as${disclosureKey}:questionswhile the subject is a groupedquestionssubject, so the open state a reader sets on a pending Codex group does not auto-expand the first question's own row once that question is answered (both share the message idask:<id>otherwise). - Test — a new receipt case builds a two-question Codex group, opens it, answers the first question, and asserts the resulting single-question row stays truncated with no toggle. The assertions fail without the key split, so the coverage is real.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Review status: ready for reviewHead: What this fixes. In structured Claude and Codex chats, a multi-question ask left a row reading "Asked: 2 questions". When the ask was cancelled, its questions were shown nowhere. While it was pending, a Codex ask showed only its first question, because the Codex answer card shows one question at a time. The row can now be opened to list every question in full, below the header, where the text can be selected. An answered ask already lists each question with its answer, so its row stays plain and nothing shows twice. Review loops. Converged in two loops.
Readiness checks. Both passed. The end check found no issues. Live QA, on a background dev build of this head on a second Mac with an isolated profile, using real structured Claude chats:
All passed. Screenshots are in the PR body. Live Codex QA was blocked by the Codex service on that machine: turns failed with an upstream HTTP 502 or ended empty, so no question reached the chat. The Codex paths are covered by tests only. Known and accepted:
Not caused by this PR (possible follow-ups):
Stacked follow-up: #23455 extends this to terminal-based chats and adds answers where the transcript records them. |
|
Codex live QA follow-up (head |
|
Codex verified live (head
There were no console errors and no duplicate-key warnings. Screenshots are in the PR body. Found during this run, not caused by this PR (this PR changes only the question-row components and shared row data, not how rows are ordered):
|

ELI5
When an agent asks you several questions at once in a native chat and you cancel (or haven't answered yet), the chat only said "Asked: 2 questions" and never showed you what the questions were. Now you can click that line to read every question in full.
What Changed
Before: in a Claude or Codex structured chat, a question prompt with more than one question left a line reading "Asked: 2 questions" (or "Awaiting user input: 2 questions") in the transcript. If you cancelled it, the questions were shown nowhere: the line could not be opened, and only answered prompts list their questions (next to each answer). While a Codex prompt is pending, the answer card shows one question at a time, so the rest were also hidden until you answered the first.
After: that line works like the single long question line from #22941. Hover shows a chevron, clicking opens a numbered list of every question in full below the line, and clicking again folds it. The line still reads "Asked: 2 questions". The list sits outside the button, so you can select and copy it. It stays open when the row scrolls out of view and back, and keyboard focus stays on the toggle when it folds. For a pending Codex prompt, each answer turns the answered question into its own closed line and the remaining questions into a new folded line.
Unchanged: an answered prompt still lists each question with its answer below the line, so its line stays plain and nothing is shown twice. A single question behaves exactly as before. The ask line inside a tool-activity run (the terminal-chat path) still reads "N questions" with no toggle; a follow-up changes that one.
Mechanism: the shared description of what the line names used to be either one question or a bare count. The count is replaced by the list of question texts, and the line derives "N questions" from its length. The line gains one option saying whether it should list the questions; it defaults to yes. The receipt turns it off only once the prompt is answered, because that is when it lists every question with its answer itself. The tool-activity run turns it off for now. The line remembers whether its list is open separately from whether a single question is open. A pending Codex prompt is drawn as one line keyed by its first question, and once that question is answered it becomes its own line under the same key; without the split it would open already expanded. That description is computed while drawing and is never saved or sent between devices, so nothing stored or sent changes shape.
Why
The line is the only lasting record of the prompt in the transcript, so it is the natural place to keep the questions readable. Reusing the same disclosure (same saved open state, focus and keyboard behaviour) keeps one pattern for "this line hides text you may need." Carrying the texts rather than a count means the line cannot claim a count it has no questions for, and the count is never stored twice. Letting the prompt record say whether it already lists the questions avoids showing them twice on answered prompts without the line needing to know how the record is drawn. A count line always hides its questions, so unlike the single-question case it needs no width measurement.
Linked Issue
None. Follow-up to #22941: a multi-question ask must show every question.
Visual Proof
Checked live in a background dev build of this branch (head
4a9a848219) on a second Mac, with an isolated profile and real structured Claude chats. Before this change the same rows read "Asked: 2 questions" with no way to open them.Pending ask: the row opens to list both questions, and the text can be selected while it stays open:

Cancelled ask: before, the questions were shown nowhere; now the row opens to list them:

Answered ask: the row stays plain and each question is shown once, with its answer:

Keyboard focus, and still open after scrolling away and back:

A single long question still unfolds, and a short one stays plain:

Codex, checked live on a second run: a default structured Codex chat cannot ask questions at all, because Codex only offers its question tool in Plan mode and a structured chat has no Plan mode. To exercise this change, that run started Codex with its own
default_mode_request_user_inputfeature switched on, through a wrapper for that run only (nothing in the user's Codex config changed).Pending three-question ask: the row opens to list every question:

After answering the first question, it becomes a plain line and the other two regroup into a row that opens again:

Answered and cancelled: every question stays readable:

Keyboard focus, and still open after scrolling away and back:

Testing
New receipt tests: a cancelled grouped prompt opens to list every question outside the button, folds with focus kept, and stays open across a remount; a pending grouped prompt lists its questions; an answered grouped prompt stays plain and shows each question once; a cancelled single question that fits stays plain text; after the first question of an opened pending Codex prompt is answered, its own line is not left expanded. The existing tool-activity test that the "2 questions" line offers no toggle still passes, and the shared tests now assert the question texts. Each new test was checked to fail with its part of the change removed.
Ran: the native-chat renderer tests and shared ask-row tests (194 files, 1952 tests),
pnpm tc,pnpm run check:code-quality:changed,pnpm run check:react-doctor:changed, and oxlint on the touched files. Live Electron QA (Claude): pending, cancelled and answered asks, text selection, keyboard, scroll away and back, and the single-question rows all behaved as described above. Live Codex QA (with Codex's own question feature switched on for the run): pending, answering one question at a time, answered, cancelled, keyboard, and scroll away and back all passed.AI Disclosure
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Renderer-only. No new user-facing text, so no translation changes. Nothing persisted or sent over the wire changes, so SSH and remote hosts and mixed client versions are unaffected. Mobile does not import the changed shared module.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)