Expand description
BP-3 (§2 module 6 tools.question, catalog row “Structured
user-question tool”): the tool a model uses to ask the USER a
multiple-choice or free-text question mid-run, and wait for the answer.
One door, not a new one. The design already names this module’s
protocol side: crate::mcp::McpElicitationHandler is documented as “the
tools.question surface’s PROTOCOL side (§2.1 dep)”. So this tool does
not invent a transport — it asks through that same handler, which under
an SDK-owned runtime is the frontend request broker
(crate::server::FrontendRequestBridge::elicitation_handler): the
request is published into the sequenced frontend event stream as a
{"type":"request","request":{…}} envelope and the turn BLOCKS on it
until harness.v1.runtimes.respond answers with the content. That is the
same broker, the same respond door, and the same request id space the
approvals path uses; the two differ only in kind (an approval is
allow/deny, a question carries structured answers back), which is exactly
why crate::approvals filters non-approval kinds out of its listing.
Headless is deny-default (§2 module 6’s own “⚡ headless print mode (deny-default like OC, oc§1)”): with no handler installed nobody can answer, so the call fails with a message telling the model to decide for itself rather than hanging or silently inventing an answer.
Shape. AskUserTool takes Claude Code’s AskUserQuestion shape —
1-4 questions, each with a short header, 1-4 labelled options, an
optional multiSelect, and (always) a free-text fallback. The same tool
object is registered under Codex’s experimental spelling
REQUEST_USER_INPUT when a preset asks for it, so a continued Codex
session’s own tool name keeps resolving.
Structs§
- AskUser
Tool - The structured user-question tool.
nameis the registered spelling —ASK_USERundercc-parity, additionallyREQUEST_USER_INPUTundercx-parity. - Question
- One question in an
AskUserToolcall. - Question
Option - One selectable answer.
- User
Question Handler - The handler
ask_userasks through, wrapped soToolContextcan stayDebug— the same newtype shape (and the same reason) ascrate::tools::ToolApprovalHandler.
Constants§
- ASK_
USER - Registered name of the question tool (Claude Code’s
AskUserQuestion). - MAX_
OPTIONS - At most four options per question (the CC shape’s own cap).
- MAX_
QUESTIONS - Claude Code’s cap: at most four questions in one call.
- REQUEST_
USER_ INPUT - Codex’s experimental spelling for the same capability (cx§1
request_user_input), registered as an alias undercx-parity.