Skip to content

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

refactor(voice): remove unused stub modules from disabled voice path

Steven Enamakel382f7c7981f0
diff --git a/crates/openhuman-core/src/voice/stub.rs b/crates/openhuman-core/src/voice/stub.rs
index 23aa5c3cf0..b8d72fcdd5 100644
--- a/crates/openhuman-core/src/voice/stub.rs
+++ b/crates/openhuman-core/src/voice/stub.rs
@@ -88,91 +88,6 @@ pub fn publish_ptt_transcript_committed(
log::debug!("[voice-stub] publish_ptt_transcript_committed ignored (voice disabled)");
}
-// ---------------------------------------------------------------------------
-// cli::run_standalone_subcommand (kept registered as a CLI adapter)
-// ---------------------------------------------------------------------------
-
-pub mod cli {
- /// Disabled: the standalone dictation server needs the voice stack. Returns
- /// an error so `openhuman voice` reports the feature is off instead of the
- /// subcommand silently disappearing from the CLI registry.
- pub fn run_standalone_subcommand(_args: &[String]) -> anyhow::Result<()> {
- Err(anyhow::anyhow!(super::DISABLED_MSG))
- }
-}
-
-// ---------------------------------------------------------------------------
-// server::{start_if_enabled, try_global_server}
-// ---------------------------------------------------------------------------
-
-pub mod server {
- use std::sync::Arc;
-
- use crate::config::Config;
-
- /// Opaque handle; never actually constructed when voice is disabled, but
- /// kept nameable so `Option<Arc<VoiceServer>>` call sites type-check.
- pub struct VoiceServer;
-
- impl VoiceServer {
- /// No-op stop — unreachable (no server is ever created).
- pub async fn stop(&self) {}
- }
-
- /// No-op: there is no voice server to start.
- pub async fn start_if_enabled(_ctx: &crate::core::runtime::DispatchCtx, _config: &Config) {}
-
- /// Always `None`: no global voice server exists.
- pub fn try_global_server() -> Option<Arc<VoiceServer>> {
- None
- }
-}
-
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-
-pub mod dictation_listener {
- use once_cell::sync::Lazy;
- use serde::Serialize;
- use tokio::sync::broadcast;
-
- use crate::config::Config;
-
- /// Mirrors the real `DictationEvent` wire shape so the Socket.IO bridge's
- /// `serde_json::to_value(&event)` + `event.event_type` access type-check.
- #[derive(Debug, Clone, Serialize)]
- pub struct DictationEvent {
- #[serde(rename = "type")]
- pub event_type: String,
- pub hotkey: String,
- pub activation_mode: String,
- }
-
- // Senders are kept alive for the process lifetime so subscribers park
- // (never receive) rather than seeing an immediate `Closed`, matching the
- // real always-open broadcast bus. Nothing is ever published.
- static DICTATION_BUS: Lazy<broadcast::Sender<DictationEvent>> =
- Lazy::new(|| broadcast::channel(1).0);
- static TRANSCRIPTION_BUS: Lazy<broadcast::Sender<String>> =
- Lazy::new(|| broadcast::channel(1).0);
-
- /// Subscribe to (never-emitting) dictation events.
- pub fn subscribe_dictation_events() -> broadcast::Receiver<DictationEvent> {
- DICTATION_BUS.subscribe()
- }
-
- /// Subscribe to (never-emitting) transcription results.
- pub fn subscribe_transcription_results() -> broadcast::Receiver<String> {
- TRANSCRIPTION_BUS.subscribe()
- }
-
- /// No-op: no hotkey listener is started.
- pub async fn start_if_enabled(_ctx: &crate::core::runtime::DispatchCtx, _config: &Config) {}
-
- /// No-op: nothing to stop.
- pub async fn stop() {}
-}
-
// `live::ws::handle_live_voice_ws`: with voice off there are no live
// providers, so the upgraded socket is dropped immediately.
#[cfg(feature = "http-server")]