diff --git a/hive-c0re/src/server.rs b/hive-c0re/src/server.rs index fb7d05b2..2248cb90 100644 --- a/hive-c0re/src/server.rs +++ b/hive-c0re/src/server.rs @@ -117,9 +117,13 @@ async fn dispatch(req: &HostRequest, coord: Arc) -> HostResponse { // The hive domain is injected into c0re's service env by // hive-c0re.nix (`HYPERHIVE_HIVE_DOMAIN`); surface it so the // operator CLI can fill in this hive's own identity. - HostRequest::HiveDomain => { - HostResponse::hive_domain(std::env::var("HYPERHIVE_HIVE_DOMAIN").ok()) - } + HostRequest::HiveDomain => HostResponse::hive_domain( + // Treat an empty env value as unset — otherwise the CLI + // would emit `swarm.peers."" = …`, invalid nix. + std::env::var("HYPERHIVE_HIVE_DOMAIN") + .ok() + .filter(|d| !d.is_empty()), + ), HostRequest::Pending => HostResponse::pending(coord.approvals.pending()?), HostRequest::Approve { id } => { actions::approve(coord.clone(), *id).await?;