From 4435666c0096354eeaf527a8b7e22a8d88e3bc31 Mon Sep 17 00:00:00 2001 From: damocles Date: Mon, 1 Jun 2026 16:29:46 +0200 Subject: [PATCH] fix(#947): include manager in agent-sockets.json --- hive-c0re/src/agent_sockets.rs | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/hive-c0re/src/agent_sockets.rs b/hive-c0re/src/agent_sockets.rs index 4ea40ed1..99cdae1d 100644 --- a/hive-c0re/src/agent_sockets.rs +++ b/hive-c0re/src/agent_sockets.rs @@ -38,7 +38,7 @@ pub const SOCKET_FILENAME: &str = "web.sock"; /// sub-agent that hasn't flipped the option yet. /// /// Renamed from `.bound` (legacy) to match the `hyperhive-` prefix -/// convention for all harness-written state files. `build_map` +/// convention for all harness-written state files (#838). `build_map` /// checks both names during the transition window so existing containers /// don't lose gateway routing before their next rebuild. pub const READY_MARKER: &str = "hyperhive-socket-bound"; @@ -67,12 +67,9 @@ pub fn socket_path_for(name: &str) -> PathBuf { } /// Compute the agent-socket map for the given logical agent names. -/// Sub-agents only — manager is filtered out at the call boundary -/// for the same reason it's filtered from `agent_ports::build_map` -/// (manager UI is routed via the c0re dashboard upstream, not via -/// `/agent//`). -/// -/// Also filters by `READY_MARKER` presence: only agents whose +/// Includes manager and sub-agents — all managed containers that have +/// bound a unix socket get an entry. Filters by `READY_MARKER` presence: +/// only agents whose /// harness has actually bound the unix socket (and dropped the /// marker) appear in the map. Without this, the gateway would /// `proxy_pass` to a non-existent socket for every sub-agent that @@ -105,7 +102,6 @@ where { names .iter() - .filter(|n| n.as_str() != MANAGER_NAME) .filter(|n| is_ready(n)) .map(|n| (n.clone(), socket_path_for(n))) .collect() @@ -241,18 +237,18 @@ mod tests { } #[test] - fn build_map_filters_manager() { - // Use `MANAGER_NAME` in the input so the assert actually - // exercises the filter path — a literal `"hm1nd"` would pass - // trivially if the constant ever changed and the filter - // silently became a no-op. All-ready predicate bypasses the - // marker check so we exercise the manager filter in isolation. + fn build_map_includes_manager() { + // Manager is now included in the gateway socket map so the + // gateway can route `/agent//` to its unix socket, + // giving the operator access to the manager's per-agent web UI + // (terminal, inbox, stats). All-ready predicate bypasses the + // marker check so we exercise the manager inclusion in isolation. let names: Vec = ["iris", MANAGER_NAME, "argus"] .iter() .map(|s| (*s).to_owned()) .collect(); let map = build_map_with(&names, |_| true); - assert!(!map.contains_key(MANAGER_NAME)); + assert!(map.contains_key(MANAGER_NAME)); assert!(map.contains_key("iris")); assert!(map.contains_key("argus")); }