description: "Web ask_user_question feature for the dsh web client: the composer-takeover question UI and the plan-review approval card."
English | 中文
When an agent asks a question in the Web client, this package replaces the chat composer with an interactive question surface. Users can move through questions, choose one or multiple options, enter custom answers, skip items, and submit one structured answer batch. Single-choice selections advance immediately, while drafts survive Session navigation for the lifetime of the page. A single question with a supported presentation intent can use a dedicated surface, including the plan-review card with Request changes and Approve actions.
When the agent asks a question, the composer becomes the question surface: answer each question, navigate with the pager, or skip it. Single-select choices advance immediately; Enter continues the flow and submits once every question is answered or skipped, while Shift+Enter breaks a line instead (during IME composition Enter only confirms the input candidate without advancing).
A multi-select draft keeps its selected labels while the user opens or edits the custom answer, so its submitted item may carry both selected and custom; a single-select custom answer remains exclusive. Question detail reuses the assistant-output MarkdownText primitive, including its GFM rendering and untrusted-content policy. The capped card keeps its title, navigation, and submission actions fixed while long detail and choices share an internal scroll region. "Skip" retains other drafts and emits the existing blank { selected: [] } result for that item, while close rejects the whole wait as ASK_CANCELLED.
A plan-review intent — set by dsh-plan-mode on the exit_plan_mode review — renders a compact approval card: a Plan review strip with a View full plan link, the plan title and a two-line plain-text summary, and Request changes / Approve actions. The complete plan opens in the sidebar through the link or its permanent Chat card. Approve answers with the asker's approval label; Request changes rejects the wait as ASK_CANCELLED, returning the composer for the user's feedback without submitting an approval. The card has no separate refusal button.
The generic question flow keeps its current page, selected labels, custom text, and explicit skips in a non-persisted Slot store scoped to the owning Session generation and keyed by the pending request's local render identity. Switching from Session A to B retires A when no other reference owns it, so returning to A starts an empty question draft; another reference that keeps A's generation alive also keeps that draft. A different request identity reads an empty draft and replaces the previous value on its first edit; a successful answer or cancellation clears the matching value. The host remains authoritative for whether the request is pending.
These pages cover the composer host, the tool seam, and the plan-mode consumer.
conversation.composer chain.plan-review intent.Indirectly, through dsh-tool-ask-user, whose model-visible schema and answer rendering this package presents in the Web client.
No direct invalidation; dsh-tool-ask-user owns the model-visible tool call and result.
These limits define draft durability and composer ownership; they are current package constraints.
localStorage, or disk.Runtime invariant: No companion is published. Tool and slot registrations are effects owned and observed by their respective registries; the host pending table is exercised through the public wire protocol.