Question tool: support multiple questions at once (AskUserQuestion 1–4), like the Claude web interface #40

Closed
opened 2026-07-08 01:25:19 +02:00 by dominik.polakovics · 1 comment

This was generated by AI during triage.

Summary

Claude's AskUserQuestion tool can present 1–4 questions at once, each with
its own options (single- or multi-select), and Claude's own web interface renders
them together. lab currently collapses this to a single question: when the
tool asks more than one, lab degrades to a "Multiple questions — answer in
claude.ai" deep-link hint instead of rendering an answerable dialog.

Request

Render and answer multi-question AskUserQuestion dialogs in the embedded chat
(up to 4 questions, each single- or multi-select, including the per-question
header), so operators don't have to bounce to claude.ai.

Notes for triage

lab already parses the full questions[] array but deliberately bails on more
than one; the single-question shape is then pinned all the way down:

  • Parser bails on >1: askUserQuestionDialog
    (internal/provider/claudecode/chat_dialog.go:38-69, the len(in.Questions) > 1
    branch at :54-60). The per-question header field is not parsed at all.
  • Single-question model: provider.Dialog / provider.DialogAnswer
    (internal/provider/provider.go:138-162) — one prompt, one flat option list,
    one multi flag, one selected-index set.
  • HTTP: single dialog envelope + scalar answer (internal/httpapi/chat.go:39-49
    and :163-194).
  • FE: DialogPanel renders one prompt / one option list with single-selection
    signals (web/src/routes/RunChat.tsx:934-1059); types at
    web/src/api.ts:460-467.
  • Hard part: lab answers by replaying keystrokes into the live tmux TUI picker
    (DialogKeystrokes, internal/provider/claudecode/interact.go:113-162). The
    recipe/geometry is pinned for exactly one picker; the multi-picker geometry
    is unpinned/unverified in internal/compat/compat.md §7 and would need to be
    established first (the highest-risk part of this change).

So this touches the backend model, parser, keystroke recipe, HTTP answer envelope,
and the DialogPanel UI — with the TUI multi-picker geometry as the main unknown.

> *This was generated by AI during triage.* ## Summary Claude's `AskUserQuestion` tool can present **1–4 questions at once**, each with its own options (single- or multi-select), and Claude's own web interface renders them together. lab currently collapses this to a **single** question: when the tool asks more than one, lab degrades to a "Multiple questions — answer in claude.ai" deep-link hint instead of rendering an answerable dialog. ## Request Render and answer multi-question `AskUserQuestion` dialogs in the embedded chat (up to 4 questions, each single- or multi-select, including the per-question `header`), so operators don't have to bounce to claude.ai. ## Notes for triage lab already *parses* the full `questions[]` array but deliberately bails on more than one; the single-question shape is then pinned all the way down: - Parser bails on >1: `askUserQuestionDialog` (`internal/provider/claudecode/chat_dialog.go:38-69`, the `len(in.Questions) > 1` branch at :54-60). The per-question `header` field is not parsed at all. - Single-question model: `provider.Dialog` / `provider.DialogAnswer` (`internal/provider/provider.go:138-162`) — one prompt, one flat option list, one multi flag, one selected-index set. - HTTP: single dialog envelope + scalar answer (`internal/httpapi/chat.go:39-49` and `:163-194`). - FE: `DialogPanel` renders one prompt / one option list with single-selection signals (`web/src/routes/RunChat.tsx:934-1059`); types at `web/src/api.ts:460-467`. - **Hard part:** lab answers by replaying keystrokes into the live tmux TUI picker (`DialogKeystrokes`, `internal/provider/claudecode/interact.go:113-162`). The recipe/geometry is pinned for exactly **one** picker; the multi-picker geometry is unpinned/unverified in `internal/compat/compat.md` §7 and would need to be established first (the highest-risk part of this change). So this touches the backend model, parser, keystroke recipe, HTTP answer envelope, and the `DialogPanel` UI — with the TUI multi-picker geometry as the main unknown.
Author
Owner

This was generated by AI during triage.

Re-triage: already resolved by #51

This landed as part of #51 ("provider seam v2 — generalize the agent-CLI
contract", merged 2026-07-08, commit 60b018e) — filed one day before that
merge, so it predates the fix.

Confirmed in the current codebase:

  • Backend model: Dialog carries Kind + Questions[], DialogAnswer carries
    per-question Answers[] (the seam described in this issue's notes).
  • Parser: askUserQuestionDialog now branches on question count — a single
    question keeps the original flat shape byte-for-byte, N ≥ 2 builds the full
    Questions form (per-question Header/options/Other row), instead of
    bailing to a degraded deep-link hint.
  • Keystroke recipe: internal/compat/compat.md §7 documents the multi-question
    tab-bar picker (← ☐ Q1hdr ☐ Q2hdr ✔ Submit →) as live-verified against
    Claude Code 2.1.198 on 2026-07-08
    — sequenced per-question recipes with a
    review step, three live recipe bugs found and fixed in that same session.
    This was the issue's own flagged "highest-risk" unknown, and it's been
    live-driven, not just coded.
  • FE: DialogPanel (web/src/routes/RunChat.tsx) renders stacked per-question
    forms from dialog.questions, positionally aligned answers, per-question
    header included; api.ts types carry questions?: Question[].

All five layers this issue called out (backend model, parser, keystroke
recipe, HTTP answer envelope, DialogPanel UI) are in place and live-verified.
Closing as resolved rather than leaving it in the triage queue.

> *This was generated by AI during triage.* ## Re-triage: already resolved by #51 This landed as part of #51 ("provider seam v2 — generalize the agent-CLI contract", merged 2026-07-08, commit `60b018e`) — filed one day before that merge, so it predates the fix. **Confirmed in the current codebase:** - Backend model: `Dialog` carries `Kind` + `Questions[]`, `DialogAnswer` carries per-question `Answers[]` (the seam described in this issue's notes). - Parser: `askUserQuestionDialog` now branches on question count — a single question keeps the original flat shape byte-for-byte, N ≥ 2 builds the full `Questions` form (per-question `Header`/options/`Other` row), instead of bailing to a degraded deep-link hint. - Keystroke recipe: `internal/compat/compat.md` §7 documents the multi-question tab-bar picker (`← ☐ Q1hdr ☐ Q2hdr ✔ Submit →`) as **live-verified against Claude Code 2.1.198 on 2026-07-08** — sequenced per-question recipes with a review step, three live recipe bugs found and fixed in that same session. This was the issue's own flagged "highest-risk" unknown, and it's been live-driven, not just coded. - FE: `DialogPanel` (`web/src/routes/RunChat.tsx`) renders stacked per-question forms from `dialog.questions`, positionally aligned answers, per-question `header` included; `api.ts` types carry `questions?: Question[]`. All five layers this issue called out (backend model, parser, keystroke recipe, HTTP answer envelope, DialogPanel UI) are in place and live-verified. Closing as resolved rather than leaving it in the triage queue.
dominik.polakovics 2026-07-09 00:31:32 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Cloonar/coding-lab#40
No description provided.