add optional in_reply_to field on send for conversation threading

This commit is contained in:
damocles 2026-05-20 13:01:02 +02:00
parent 03db764101
commit 67b47872e0
9 changed files with 90 additions and 16 deletions

View file

@ -314,6 +314,12 @@ pub struct SendArgs {
pub to: String,
/// Message body. Plain text; the broker doesn't parse it.
pub body: String,
/// Optional broker row-id of the message this is a reply to. Lets
/// the dashboard render conversation threads. Pass the `id` from the
/// `DeliveredMessage` you're responding to; omit for new threads.
/// Silently ignored if the id is unknown or out of retention.
#[serde(default)]
pub in_reply_to: Option<i64>,
}
#[derive(Debug, serde::Deserialize, schemars::JsonSchema)]
@ -410,6 +416,7 @@ impl AgentServer {
.dispatch(hive_sh4re::AgentRequest::Send {
to: args.to,
body: args.body,
in_reply_to: args.in_reply_to,
})
.await;
annotate_retries(format_ack(resp, "send", format!("sent to {to}")), retries)
@ -802,6 +809,7 @@ impl ManagerServer {
.dispatch(hive_sh4re::ManagerRequest::Send {
to: args.to,
body: args.body,
in_reply_to: args.in_reply_to,
})
.await;
annotate_retries(format_ack(resp, "send", format!("sent to {to}")), retries)