Ask user middleware for interactive question-answering during agent execution.
Placeholder recorded for every question when the user cancels the prompt.
Render the placeholder answer recorded for every question on failure.
Render questions and answers as the Q:/A: transcript.
This is the text the ask_user tool returns to the model and persists in the
thread. The TUI renders that authoritative text literally rather than trying
to parse the unrestricted answer content back into structured data.
Answers are interpolated unescaped, so the encoding is not unambiguously
decodable: an answer containing a blank line followed by a literal
Q: <text>\nA: header is indistinguishable from a real block boundary. Only
the model reads it that way today. Any future decoder must anchor on the known
question text rather than on a generic Q: pattern, or a crafted answer can
fabricate an extra question/answer pair.
Trusted same-turn authorization recorded after an ask_user response.
Request payload sent via interrupt when asking the user questions.
A question to ask the user.
Middleware that provides an ask_user tool for interactive questioning.
This middleware adds an ask_user tool that allows agents to ask the user
questions during execution. Questions can be free-form text or multiple choice.
The tool uses LangGraph interrupts to pause execution and wait for user input.