hive-c0re: push Killed as a todo, not a broker message

This commit is contained in:
damocles 2026-08-02 23:48:31 +02:00 committed by mara
commit 1f448a7818
2 changed files with 18 additions and 6 deletions

View file

@ -429,9 +429,15 @@ async fn run_stop(coord: &Arc<Coordinator>, name: &str) -> Result<()> {
// own kind now.
crate::lifecycle::kill(name).await?;
coord.unregister_agent(name);
coord.notify_manager(&hive_sh4re::HelperEvent::Killed {
agent: name.to_owned(),
});
coord
.push_todo(
hive_sh4re::MANAGER_AGENT,
"core",
Some(format!("killed:{name}")),
format!("agent '{name}' killed"),
None,
)
.await;
coord.rescan_containers_and_emit().await;
Ok(())
}

View file

@ -129,9 +129,15 @@ pub(super) async fn handle_kill(coord: &Arc<Coordinator>, agent: &str, name: &st
.await;
match result {
Ok(()) => {
coord.notify_manager(&hive_sh4re::HelperEvent::Killed {
agent: name.to_owned(),
});
coord
.push_todo(
hive_sh4re::MANAGER_AGENT,
"core",
Some(format!("killed:{name}")),
format!("agent '{name}' killed"),
None,
)
.await;
Response::Ok
}
Err(e) => Response::Err {