diff --git a/hive-ag3nt/src/mcp.rs b/hive-ag3nt/src/mcp.rs index 2ff5c7d9..540c37b9 100644 --- a/hive-ag3nt/src/mcp.rs +++ b/hive-ag3nt/src/mcp.rs @@ -743,7 +743,8 @@ impl AgentServer { let mcp_items = crate::mcp_loose_ends::collect(); if !mcp_items.is_empty() { use std::fmt::Write as _; - let _ = write!(out, "\n\nlocal task(s):"); + let n = mcp_items.len(); + let _ = write!(out, "\n\n{n} local task(s):"); for item in &mcp_items { let _ = write!(out, "\n- {item}"); } diff --git a/hive-ag3nt/src/mcp_loose_ends.rs b/hive-ag3nt/src/mcp_loose_ends.rs index e7e537e0..222a6392 100644 --- a/hive-ag3nt/src/mcp_loose_ends.rs +++ b/hive-ag3nt/src/mcp_loose_ends.rs @@ -10,6 +10,9 @@ use std::path::PathBuf; +/// NOTE: the base-dir resolution logic here is intentionally mirrored in +/// `hive-bash-mcp/src/paths.rs::mcp_loose_ends_dir()`. They can't share +/// code across crates — keep them in sync if the fallback logic changes. fn loose_ends_dir() -> PathBuf { let base = if let Some(p) = std::env::var_os("HYPERHIVE_HARNESS_DIR") { PathBuf::from(p) diff --git a/hive-bash-mcp/src/paths.rs b/hive-bash-mcp/src/paths.rs index 854bcc9c..dd4c5a70 100644 --- a/hive-bash-mcp/src/paths.rs +++ b/hive-bash-mcp/src/paths.rs @@ -51,6 +51,10 @@ pub fn hyperhive_socket() -> PathBuf { /// Directory where MCP daemons write loose-end summary files for the harness. /// Each daemon writes `.json` here; the harness scans the dir in /// `get_loose_ends` to surface active work from all MCPs generically. +/// +/// NOTE: the base-dir resolution logic here is intentionally mirrored in +/// `hive-ag3nt/src/mcp_loose_ends.rs::loose_ends_dir()`. They can't share +/// code across crates — keep them in sync if the fallback logic changes. #[must_use] pub fn mcp_loose_ends_dir() -> PathBuf { let base = if let Some(p) = std::env::var_os("HYPERHIVE_HARNESS_DIR") { diff --git a/nix/templates/harness-base.nix b/nix/templates/harness-base.nix index 20abfb36..7315e5cc 100644 --- a/nix/templates/harness-base.nix +++ b/nix/templates/harness-base.nix @@ -1130,6 +1130,14 @@ in HIVE_BASH_SOCKET = "/run/hive-bash/socket"; HIVE_CONTROL_SOCKET = "/run/hive/mcp.sock"; RUST_LOG = "info"; + # HYPERHIVE_HARNESS_DIR and HYPERHIVE_STATE_DIR are already + # injected via systemd.globalEnvironment by the meta flake + # (set to /agents//harness and /agents//state + # respectively). Listed here for explicitness — the daemon + # uses these to derive its task + loose-ends dir paths. + # Without them the daemon falls back to deriving harness/ as a + # sibling of state/, which produces the same value but is + # less robust if the two vars ever diverge. }; serviceConfig = { ExecStart = "${pkgs.hyperhive}/bin/hive-bash-daemon";