type ask to target as Ident (#2621)

This commit is contained in:
damocles 2026-07-22 18:40:26 +02:00 committed by mara
commit 3df565789c
6 changed files with 12 additions and 3 deletions

View file

@ -181,13 +181,17 @@ impl AgentServer {
async fn ask(&self, Parameters(args): Parameters<AskArgs>) -> String {
let log = format!("{args:?}");
run_tool_envelope("ask", log, async move {
let to = match args.to.map(|t| hive_types::Ident::parse(&t)).transpose() {
Ok(to) => to,
Err(reason) => return format!("invalid `to` agent name: {reason}"),
};
let (resp, retries) = self
.dispatch(hive_core_agent_sock::Request::Ask {
question: args.question,
options: args.options,
multi: args.multi,
ttl_seconds: args.ttl_seconds,
to: args.to,
to,
})
.await;
let s = match resp {