fix(947): strip prose/issue-tags from agent_sockets.rs

This commit is contained in:
damocles 2026-06-01 16:44:53 +02:00 committed by mara
commit e7a5718e83

View file

@ -1,8 +1,8 @@
//! `/var/lib/hyperhive/agent-sockets.json` writer. Sibling to
//! `agent_ports.rs`; same atomic `<path>.tmp` + `rename()` shape so
//! the gateway's nginx worker never reads a partial file. Manager
//! excluded from the map (manager UI routes via the dashboard
//! upstream, not per-agent `/agent/<name>/`).
//! the gateway's nginx worker never reads a partial file. Includes
//! manager and sub-agents so the gateway can route
//! `/agent/<name>/` for all containers with a bound unix socket.
//!
//! Full mechanism — per-agent subdir bind-mount, `hyperhive-socket-bound`
//! marker gate, gateway UDS upstream, transition vs `agent-ports.json`,
@ -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 (#838). `build_map`
/// convention for all harness-written state files. `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,11 +67,9 @@ pub fn socket_path_for(name: &str) -> PathBuf {
}
/// Compute the agent-socket map for the given logical agent names.
/// 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
/// Includes manager and sub-agents. Filters by `READY_MARKER`
/// presence: only agents whose harness has actually bound the unix
/// socket appear in the map. Without this, the gateway would
/// `proxy_pass` to a non-existent socket for every sub-agent that
/// hasn't yet flipped `hyperhive.web.useUnixSocket = true`.
///
@ -238,11 +236,6 @@ mod tests {
#[test]
fn build_map_includes_manager() {
// Manager is now included in the gateway socket map so the
// gateway can route `/agent/<manager-name>/` 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<String> = ["iris", MANAGER_NAME, "argus"]
.iter()
.map(|s| (*s).to_owned())
@ -339,3 +332,4 @@ mod tests {
assert!(body.contains("\"/run/hive-agent/iris/web.sock\""));
}
}