Skip to main content

ask_user

Function ask_user 

Source
pub(crate) async fn ask_user(
    state: &AppState,
    agent_block_id: &str,
    question: Value,
) -> Result<UserAnswer, String>
Expand description

Ask the user a question about the agent in agent_block_id, in an approval subwindow the host opens over the window showing it (crates/cef ssh_approval), and wait for the answer.

Through the host’s own IPC server and its token, which no agent holds, and answered in a window the browser API never resolves a pane into: an agent can neither click this answer nor forge it, unlike a modal in the main window answered through srv’s own services (both reachable with the auth key every agent has). With no host connected (headless) there is no one to ask: Err, so whatever needed the answer does not happen.