fix(#1118): coalesce multi-hop reparent notifications for offline agents

This commit is contained in:
damocles 2026-06-03 09:37:43 +02:00 committed by mara
commit 16f13e3b25
2 changed files with 78 additions and 6 deletions

View file

@ -616,12 +616,12 @@ impl Coordinator {
in_reply_to: None,
});
}
let _ = self.broker.send(&hive_sh4re::Message {
from: hive_sh4re::SYSTEM_SENDER.to_owned(),
to: child.to_owned(),
body: format!("your parent changed from {old_label} to {new_label}"),
in_reply_to: None,
});
// Coalesce: if a prior move notification is already pending in
// the broker (agent was offline for multiple moves), update it
// in-place so the agent sees "A to C" not "A to B" then "B to C".
let _ = self
.broker
.send_coalescing_reparent(child, old_label, new_label);
}
// Rescan + diff-emit regardless of whether messages fired —