Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(rpc): guard voice websocket handlers behind feature flags

Steven Enamakel3d9d4680b566
diff --git a/crates/openhuman-rpc/src/server/http/dictation.rs b/crates/openhuman-rpc/src/server/http/dictation.rs
index 5912ee53fe..88f47c52fb 100644
--- a/crates/openhuman-rpc/src/server/http/dictation.rs
+++ b/crates/openhuman-rpc/src/server/http/dictation.rs
@@ -47,7 +47,14 @@ pub(super) async fn dictation_ws_handler(
return;
}
};
+ #[cfg(all(feature = "voice", feature = "http-server"))]
crate::core_host::voice::streaming::handle_dictation_ws(socket, config).await;
+ #[cfg(not(all(feature = "voice", feature = "http-server")))]
+ {
+ // The core only carries the dictation socket with voice compiled in.
+ let _ = (socket, config);
+ log::warn!("[ws] dictation requested but this build has no voice support");
+ }
})
}
diff --git a/crates/openhuman-rpc/src/server/http/live_voice.rs b/crates/openhuman-rpc/src/server/http/live_voice.rs
index 11a4754d1a..8bc3dfe99b 100644
--- a/crates/openhuman-rpc/src/server/http/live_voice.rs
+++ b/crates/openhuman-rpc/src/server/http/live_voice.rs
@@ -31,6 +31,13 @@ pub(super) async fn live_voice_ws_handler(
return;
}
};
+ #[cfg(feature = "voice")]
crate::core_host::voice::live::ws::handle_live_voice_ws(socket, config).await;
+ #[cfg(not(feature = "voice"))]
+ {
+ // The core only carries the live-voice socket with voice compiled in.
+ let _ = (socket, config);
+ log::warn!("[ws] live voice requested but this build has no voice support");
+ }
})
}