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

@ -17,6 +17,7 @@ clap.workspace = true
hive-agent-sock.workspace = true
hive-core-agent-sock.workspace = true
hive-sh4re.workspace = true
hive-types.workspace = true
rmcp.workspace = true
serde.workspace = true
serde_json.workspace = true

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 {