Expand description
Ask tool — ask the user one or more clarifying questions via the TUI overlay. Ask tool — ask the user one or more questions via the TUI overlay.
Architecture (omp ask style, adapted to oxicode’s ratatui stack):
AskBridgeis created inoxicode-cliand shared (viaArc) betweenAskTool(agent thread) andAppState(TUI main thread).- When the tool executes, it creates a oneshot channel and stores
(questions, sender) in the bridge — a single round-trip. The overlay
drives the sequential, one-question-at-a-time flow internally
(←/→ to move between questions), matching omp’s
askSingleQuestionUX. - The TUI main loop polls the bridge; when a pending ask is found it
creates an
AskOverlayto display it. - User interaction drives the overlay to send an
AskResponsevia the oneshotSender. The tool’sexecute()receives it viarx.await. - Abort (Ctrl+C) is handled via
tokio::select!with the abort signal.
The transcript renderer (format_ask_result in oxicode-tui) reconstructs the
“filled menu” (every option re-shown with its selection marker filled) by
combining the call arguments (the full option list) with the result text
(which option was selected).
Structs§
- Answer
- A single answer to a question.
- AskBridge
- Shared bridge between the ask tool (agent thread) and the TUI overlay (main
thread). Created in
oxicode-cli, injected into both the tool andAppState. - AskResponse
- Response from user interaction.
- AskTool
- The ask tool — asks the user one or more questions via TUI overlay.
- Pending
Ask - A pending ask waiting for user interaction.
The
responderis a oneshotSender— the overlay callssend()when the user submits or cancels, and the tool’srx.awaitreceives it. - Question
- A single question to ask the user.
- Question
Option - An option within a question.
Functions§
- format_
answers - Format answers into a human-readable text for the tool result.