Skip to content

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

chore(voice): remove voice subsystem wiring

Steven Enamakel9803fe3cdea6
diff --git a/crates/openhuman-core/src/core/all.rs b/crates/openhuman-core/src/core/all.rs
index 930a24ea58..193d64a73d 100644
--- a/crates/openhuman-core/src/core/all.rs
+++ b/crates/openhuman-core/src/core/all.rs
@@ -288,15 +288,6 @@ fn extension_namespace_description(namespace: &str) -> Option<&'static str> {
/// Returns a reference to the global CLI adapter registry.
fn cli_adapters() -> &'static [RegisteredCliAdapter] {
CLI_ADAPTERS.get_or_init(|| {
- // The `voice` namespace stays registered regardless of the `voice`
- // feature: with the feature off, `voice::cli::run_standalone_subcommand`
- // resolves to the facade stub, which returns a "voice disabled" error so
- // `openhuman voice` fails gracefully instead of the subcommand vanishing.
- vec![
- RegisteredCliAdapter {
- namespace: "voice",
- handler: crate::voice::cli::run_standalone_subcommand,
- },
// Bare `openhuman subsystems` prints the slot table; `openhuman
// subsystems status` still routes through the generic namespace
// dispatcher and prints JSON.
diff --git a/crates/openhuman-core/src/security/credentials/ops/gated_services.rs b/crates/openhuman-core/src/security/credentials/ops/gated_services.rs
index a33179e6b3..2c7a54af74 100644
--- a/crates/openhuman-core/src/security/credentials/ops/gated_services.rs
+++ b/crates/openhuman-core/src/security/credentials/ops/gated_services.rs
@@ -1,5 +1,5 @@
-//! Login-gated background services (local AI, voice) started on session
-//! store and stopped on session clear, plus the embedder-host detection
+//! Login-gated background services (local AI) started on session store and
+//! stopped on session clear, plus the embedder-host detection
//! that gates global (operator-wide) activation side effects.
use crate::config::Config;
@@ -40,30 +40,13 @@ pub(super) fn spawn_integrations_cache_warm(config: &Config) {
});
}
-/// Start all login-gated background services (local AI and voice). Called both
+/// Start login-gated background services. Called both
/// from the initial boot path (when an existing
/// session is detected) and from `set_credential()` when a credential is installed.
pub async fn start_credential_gated_services(
ctx: &crate::core::runtime::DispatchCtx,
config: &Config,
) {
- // These login-gated services are mutually independent — the ONLY ordering
- // constraint is voice-server → standalone-dictation-listener (they contend
- // for the single rdev global listener on macOS). Previously each was
- // `.await`ed in series, so their cold-start costs SUMMED: the local-AI
- // bootstrap (Ollama/embeddings) + voice startup
- // stacked into the ~10s stall users hit before hotkeys/commands were usable
- // — worst on Windows (#3490). Worse,
- // the hotkey/command registration (steps 2–3) sat
- // *after* the local-AI bootstrap in the series, so commands could not
- // register until Ollama finished warming.
- //
- // Run them concurrently on independent tasks instead: readiness is bounded
- // by the slowest single service rather than their sum, and command
- // registration no longer waits behind local-AI warm-up. Each task logs its
- // own elapsed time so a future regression can be attributed to one stage; a
- // panic in one service is logged on join and never aborts the others.
-
// Unit tests must not launch the real login-gated background services: they
// include detached listeners that outlive the test that spawned them and interleave with the
// shared process state (HOME / active_user.toml) of the parallel `cargo
@@ -121,30 +104,6 @@ pub async fn start_credential_gated_services(
));
}
- // 2+3. Voice hotkey services — the user-facing command registration. The
- // embedded voice server owns the single rdev listener; the standalone
- // dictation listener only starts when the server is NOT auto-starting,
- // so keep these two ordered *relative to each other* (but concurrent
- // with everything else).
- {
- let config = config.clone();
- let ctx = ctx.clone();
- tasks.push((
- "voice_hotkey",
- tokio::spawn(async move {
- let step = std::time::Instant::now();
- crate::voice::server::start_if_enabled(&ctx, &config).await;
- if !config.voice_server.auto_start && config.components.voice {
- crate::voice::dictation_listener::start_if_enabled(&ctx, &config).await;
- }
- log::debug!(
- "[services] voice hotkey services registered ({} ms)",
- step.elapsed().as_millis()
- );
- }),
- ));
- }
-
let total = tasks.len();
let mut failed = 0usize;
for (name, task) in tasks {
@@ -171,12 +130,6 @@ pub async fn stop_credential_gated_services(
ctx: &crate::core::runtime::DispatchCtx,
config: &Config,
) {
- // 2. Voice server
- if let Some(server) = crate::voice::server::try_global_server() {
- server.stop().await;
- log::info!("[services] voice server stopped on logout");
- }
-
// 4. Local AI — reset state to idle. OpenHuman never owns the local
// runtime process (the user runs Ollama / LM Studio / MLX), so there is
// nothing to stop; we only clear the cached probe verdict so the
@@ -188,16 +141,6 @@ pub async fn stop_credential_gated_services(
log::info!("[services] local AI reset to idle on logout");
}
- // 5. Dictation listener — abort the hotkey forwarder task so it doesn't
- // accumulate duplicate rdev listeners across logout → login cycles.
- crate::voice::dictation_listener::stop().await;
-
- // 6. Disable delivery and release module-owned microphone/output leases.
- #[cfg(feature = "voice")]
- if let Err(error) = crate::voice::capture_lease::close_all().await {
- log::warn!("[services] voice capture cleanup pending: {error}");
- }
-
if let Err(error) = crate::integrations::composio::trigger_history::close_global(ctx).await {
log::warn!("[composio][history] archive release failed on sign-out: {error}");
}
diff --git a/crates/openhuman-core/src/voice/schemas/mod.rs b/crates/openhuman-core/src/voice/schemas/mod.rs
index 342c8f7039..fba276f63c 100644
--- a/crates/openhuman-core/src/voice/schemas/mod.rs
+++ b/crates/openhuman-core/src/voice/schemas/mod.rs
@@ -7,10 +7,8 @@
//! - `helpers.rs` — shared plumbing (`to_json`, `deserialize_params`,
//! provider validation, silent-WAV generation).
//! - `handlers.rs` — re-exports the actual `handle_voice_*` /
-//! `handle_overlay_stt_notify` implementations, split further into
-//! `handlers/transcribe_tts.rs` (transcription, synthesis, factory-dispatch)
-//! and `handlers/provider_server.rs` (provider settings, model listing,
-//! provider testing, dictation-server lifecycle).
+//! handlers for transcription, synthesis, factory dispatch, and provider
+//! settings.
mod handlers;
mod helpers;
@@ -25,10 +23,6 @@ pub use registry::{all_voice_controller_schemas, all_voice_registered_controller
// ---------------------------------------------------------------------------
#[cfg(test)]
-use handlers::{
- handle_overlay_stt_notify, handle_voice_server_start, handle_voice_server_status,
- handle_voice_server_stop,
-};
#[cfg(test)]
use helpers::{
deserialize_params, generate_silent_wav, to_json, validate_stt_provider, validate_tts_provider,
diff --git a/crates/openhuman-embed/src/host_internals.rs b/crates/openhuman-embed/src/host_internals.rs
index ecf11e14e9..c03f804a24 100644
--- a/crates/openhuman-embed/src/host_internals.rs
+++ b/crates/openhuman-embed/src/host_internals.rs
@@ -468,11 +468,6 @@ pub mod profiles {
}
pub mod voice {
- pub mod dictation_listener {
- pub use openhuman_core::voice::dictation_listener::{
- subscribe_dictation_events, subscribe_transcription_results,
- };
- }
// Where feature unification differs between embed and core, rpc still names
// the live-voice path; embed supplies a socket-dropping stand-in.
pub mod live {
diff --git a/crates/openhuman-rpc/src/server/socketio.rs b/crates/openhuman-rpc/src/server/socketio.rs
index 8654f5c57b..b0a7449a78 100644
--- a/crates/openhuman-rpc/src/server/socketio.rs
+++ b/crates/openhuman-rpc/src/server/socketio.rs
@@ -2,7 +2,7 @@
//!
//! `spawn_web_channel_bridge` spawns one forwarding task per source. Domain
//! broadcast channels: web-chat events (`openhuman::web_chat`), dictation hotkeys
-//! and transcription results (`openhuman::voice::dictation_listener`), core notifications
+//! and transcription results (the live-voice transport), core notifications
//! (`openhuman::desktop::notifications`), and shell companion state
//! (`COMPANION_STATE_BUS`). `DomainEvent`s read off `openhuman::core::bus::BUS`:
//! session expiry, MCP setup secret requests, memory sync and tree-build
@@ -591,28 +591,7 @@ pub fn spawn_web_channel_bridge(io: SocketIo) {
// 2. Dictation hotkey events → broadcast to all connected clients.
tokio::spawn(async move {
- let mut rx = crate::core_host::voice::dictation_listener::subscribe_dictation_events();
- loop {
- let event = match rx.recv().await {
- Ok(event) => event,
- Err(tokio::sync::broadcast::error::RecvError::Lagged(skipped)) => {
- log::warn!("[socketio] dropped {skipped} events due to lag");
- continue;
- }
- Err(tokio::sync::broadcast::error::RecvError::Closed) => break,
- };
- if let Ok(payload) = serde_json::to_value(&event) {
- log::debug!(
- "[socketio] broadcast dictation:{} to all clients",
- event.event_type
- );
- // Support both colon and underscore versions for compatibility with different frontends.
- let _ = io.emit("dictation:toggle", &payload);
- let _ = io.emit("dictation_toggle", &payload);
- }
- }
- log::debug!("[socketio] dictation bridge stopped");
});
// Shell companion state → broadcast to all clients. The main renderer also
@@ -799,28 +778,7 @@ pub fn spawn_web_channel_bridge(io: SocketIo) {
// 5. Transcription results → broadcast to all connected clients.
tokio::spawn(async move {
- let mut rx = crate::core_host::voice::dictation_listener::subscribe_transcription_results();
- loop {
- let text = match rx.recv().await {
- Ok(text) => text,
- Err(tokio::sync::broadcast::error::RecvError::Lagged(skipped)) => {
- log::warn!(
- "[socketio] dropped {} transcription events due to lag",
- skipped
- );
- continue;
- }
- Err(tokio::sync::broadcast::error::RecvError::Closed) => break,
- };
- log::debug!(
- "[socketio] broadcast dictation:transcription ({} chars) to all clients",
- text.len()
- );
- let payload = serde_json::json!({ "text": text });
- let _ = io_transcription.emit("dictation:transcription", &payload);
- }
- log::debug!("[socketio] transcription bridge stopped");
});
// 8. Memory sync stage + tree-build progress → broadcast to all clients