cleanup(#1177): unify manager socket path, remove dead manager-name branches, rename ensure_manager

This commit is contained in:
damocles 2026-06-03 20:32:43 +02:00 committed by mara
commit eb3c6cd0c4
8 changed files with 36 additions and 41 deletions

View file

@ -190,6 +190,8 @@ fn known_agents(_coord: &Coordinator) -> std::collections::HashSet<String> {
// safe (we're not in a `current_thread` runtime).
use std::collections::HashSet;
let mut out: HashSet<String> = HashSet::new();
// Manager is always a scheduled-prompt target (fail-safe: include
// it even if `list()` fails so prompts to the manager never silently drop).
out.insert(hive_sh4re::MANAGER_AGENT.to_owned());
let containers = tokio::task::block_in_place(|| {
tokio::runtime::Handle::current().block_on(crate::lifecycle::list())
@ -199,9 +201,9 @@ fn known_agents(_coord: &Coordinator) -> std::collections::HashSet<String> {
for raw in list {
if let Some(name) = raw.strip_prefix(crate::lifecycle::AGENT_PREFIX) {
out.insert(name.to_owned());
} else if raw == crate::lifecycle::MANAGER_NAME {
out.insert(hive_sh4re::MANAGER_AGENT.to_owned());
}
// Note: the old `else if raw == MANAGER_NAME` branch was dead code;
// the manager container uses the h- prefix like all other agents.
}
}
Err(e) => {
@ -376,9 +378,9 @@ async fn known_agents_async() -> std::collections::HashSet<String> {
for raw in list {
if let Some(name) = raw.strip_prefix(crate::lifecycle::AGENT_PREFIX) {
out.insert(name.to_owned());
} else if raw == crate::lifecycle::MANAGER_NAME {
out.insert(hive_sh4re::MANAGER_AGENT.to_owned());
}
// Note: the old `else if raw == MANAGER_NAME` branch was dead code;
// the manager container uses the h- prefix like all other agents.
}
}
Err(e) => {