diff --git a/hive-ag3nt/src/bin/hive.rs b/hive-ag3nt/src/bin/hive.rs index 53a5f9cb..95a60e8c 100644 --- a/hive-ag3nt/src/bin/hive.rs +++ b/hive-ag3nt/src/bin/hive.rs @@ -205,10 +205,6 @@ trait Surface { /// system-prompt block + tool registration goes into the spawned /// `claude` process. const FLAVOR: mcp::Flavor; - /// Fallback agent label when `HIVE_LABEL` isn't in the environment. - /// Real deploys always set the env var; the fallback covers - /// standalone `nix run .#hive` invocations. - const DEFAULT_LABEL: &'static str; /// `is_manager` flag passed to `forge_notify::run`. Picks which /// wire enum (`AgentRequest::Wake` vs `ManagerRequest::Wake`) the /// poller uses to push notifications into the harness inbox — the @@ -271,7 +267,6 @@ struct AgentSurface; impl Surface for AgentSurface { const FLAVOR: mcp::Flavor = mcp::Flavor::Agent; - const DEFAULT_LABEL: &'static str = "hive-ag3nt"; const FORGE_IS_MANAGER: bool = false; async fn ack_turn(socket: &Path) { @@ -410,7 +405,6 @@ struct ManagerSurface; impl Surface for ManagerSurface { const FLAVOR: mcp::Flavor = mcp::Flavor::Manager; - const DEFAULT_LABEL: &'static str = "hm1nd"; const FORGE_IS_MANAGER: bool = true; async fn ack_turn(socket: &Path) { @@ -556,7 +550,14 @@ async fn serve_main(socket: &Path, poll_ms: u64) -> Result<()> { .ok() .and_then(|s| s.parse::().ok()) .unwrap_or(DEFAULT_WEB_PORT); - let label = std::env::var("HIVE_LABEL").unwrap_or_else(|_| S::DEFAULT_LABEL.into()); + // `HIVE_LABEL` is set unconditionally by the meta-flake envelope + // for any container-deployed agent; the `"hive"` fallback here + // covers standalone `nix run .#hive` invocations and pre-meta + // dev shells. Previously this was per-role (`"hive-ag3nt"` / + // `"hm1nd"`) — closing #788 collapsed it: there's no semantic + // reason for the fallback to differ when the env var is missing, + // and both branches are unreachable in production. + let label = std::env::var("HIVE_LABEL").unwrap_or_else(|_| "hive".into()); let claude_dir = login::default_dir(); let initial = LoginState::from_dir(&claude_dir); tracing::info!(state = ?initial, claude_dir = %claude_dir.display(), "harness boot");