Skip to content

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

refactor(voice): remove always-on listening and wake word settings

Steven Enamakelb78c48a5b949
diff --git a/crates/openhuman-core/src/config/ops/ui.rs b/crates/openhuman-core/src/config/ops/ui.rs
index 7906f94c32..0cca5539f9 100644
--- a/crates/openhuman-core/src/config/ops/ui.rs
+++ b/crates/openhuman-core/src/config/ops/ui.rs
@@ -49,8 +49,6 @@ pub struct VoiceServerSettingsPatch {
pub min_duration_secs: Option<f32>,
pub silence_threshold: Option<f32>,
pub custom_dictionary: Option<Vec<String>>,
- pub always_on_enabled: Option<bool>,
- pub wake_word: Option<String>,
/// Hosted STT engine name — `"backend"` / `"elevenlabs"` / `"openai"`
/// (the `"cloud"` / `"openhuman"` aliases also resolve to backend).
pub stt_engine: Option<String>,
@@ -463,8 +461,6 @@ pub async fn get_voice_server_settings(
"min_duration_secs": config.voice_server.min_duration_secs,
"silence_threshold": config.voice_server.silence_threshold,
"custom_dictionary": config.voice_server.custom_dictionary,
- "always_on_enabled": config.voice_server.always_on_enabled,
- "wake_word": config.voice_server.wake_word,
"stt_engine": config.voice_server.stt_engine,
});
Ok(Outcome::new(
@@ -512,12 +508,6 @@ pub async fn load_and_apply_voice_server_settings(
if let Some(custom_dictionary) = update.custom_dictionary {
config.voice_server.custom_dictionary = custom_dictionary;
}
- if let Some(always_on_enabled) = update.always_on_enabled {
- config.voice_server.always_on_enabled = always_on_enabled;
- }
- if let Some(wake_word) = update.wake_word {
- config.voice_server.wake_word = wake_word.trim().to_string();
- }
if let Some(engine) = update.stt_engine {
// Reject rather than silently defaulting: an unknown engine name means
// the caller and the core disagree about what is available, and quietly
diff --git a/crates/openhuman-core/src/config/schema/voice_server.rs b/crates/openhuman-core/src/config/schema/voice_server.rs
index 65588eaa54..6c159ec9de 100644
--- a/crates/openhuman-core/src/config/schema/voice_server.rs
+++ b/crates/openhuman-core/src/config/schema/voice_server.rs
@@ -119,43 +119,6 @@ pub struct VoiceServerConfig {
#[serde(default)]
pub custom_dictionary: Vec<String>,
- /// Phase 2 — always-on listening. When true, the voice server keeps the
- /// microphone open continuously and segments utterances with
- /// voice-activity detection (VAD) instead of requiring a hotkey press.
- /// Off by default: always-on listening has obvious privacy weight, so it
- /// is strictly opt-in.
- #[serde(default)]
- pub always_on_enabled: bool,
-
- /// VAD speech-onset threshold (peak RMS energy). A frame whose RMS rises
- /// above this is treated as the start of speech. Slightly higher than the
- /// hotkey `silence_threshold` because an always-open mic must reject more
- /// ambient noise before opening an utterance.
- #[serde(default = "default_vad_onset_threshold")]
- pub vad_onset_threshold: f32,
-
- /// VAD hangover: how long (milliseconds) RMS must stay below the onset
- /// threshold before the current utterance is considered finished. Prevents
- /// chopping an utterance on natural mid-sentence pauses.
- #[serde(default = "default_vad_hangover_ms")]
- pub vad_hangover_ms: u32,
-
- /// Minimum speech duration (milliseconds) for a segment to be emitted.
- /// Shorter blips (a cough, a door) are discarded before transcription.
- #[serde(default = "default_vad_min_speech_ms")]
- pub vad_min_speech_ms: u32,
-
- /// Hard ceiling (seconds) on a single always-on utterance. Forces a flush
- /// so a continuous noise source can't grow an unbounded recording.
- #[serde(default = "default_vad_max_utterance_secs")]
- pub vad_max_utterance_secs: f32,
-
- /// Wake word for always-on mode. An utterance is only delivered to the agent
- /// when its transcript contains this phrase; the phrase is stripped and the
- /// remainder is sent as the command. Empty = no wake word (deliver every
- /// utterance). Default "Hey Tiny".
- #[serde(default = "default_wake_word")]
- pub wake_word: String,
}
fn default_hotkey() -> String {
@@ -170,26 +133,6 @@ fn default_silence_threshold() -> f32 {
0.002
}
-fn default_vad_onset_threshold() -> f32 {
- 0.01
-}
-
-fn default_vad_hangover_ms() -> u32 {
- 800
-}
-
-fn default_vad_min_speech_ms() -> u32 {
- 300
-}
-
-fn default_vad_max_utterance_secs() -> f32 {
- 30.0
-}
-
-fn default_wake_word() -> String {
- "Hey Tiny".to_string()
-}
-
impl Default for VoiceServerConfig {
fn default() -> Self {
Self {
@@ -201,12 +144,6 @@ impl Default for VoiceServerConfig {
min_duration_secs: default_min_duration(),
silence_threshold: default_silence_threshold(),
custom_dictionary: Vec::new(),
- always_on_enabled: false,
- vad_onset_threshold: default_vad_onset_threshold(),
- vad_hangover_ms: default_vad_hangover_ms(),
- vad_min_speech_ms: default_vad_min_speech_ms(),
- vad_max_utterance_secs: default_vad_max_utterance_secs(),
- wake_word: default_wake_word(),
}
}
}
diff --git a/crates/openhuman-core/src/config/schema/voice_server_tests.rs b/crates/openhuman-core/src/config/schema/voice_server_tests.rs
index 18c28893a9..2f71abd534 100644
--- a/crates/openhuman-core/src/config/schema/voice_server_tests.rs
+++ b/crates/openhuman-core/src/config/schema/voice_server_tests.rs
@@ -1,18 +1,5 @@
use super::*;
-#[test]
-fn defaults_are_opt_in_and_sane() {
- let c = VoiceServerConfig::default();
- // Always-on is privacy-sensitive — must default off.
- assert!(!c.always_on_enabled);
- // Onset must sit above the hotkey silence floor so an open mic rejects
- // ambient noise that the push-to-talk path would have tolerated.
- assert!(c.vad_onset_threshold > c.silence_threshold);
- assert!(c.vad_hangover_ms > 0);
- assert!(c.vad_min_speech_ms > 0);
- assert!(c.vad_max_utterance_secs > 0.0);
-}
-
#[test]
fn stt_engine_defaults_to_backend_and_maps_to_routing_strings() {
assert_eq!(VoiceServerConfig::default().stt_engine, SttEngine::Backend);
@@ -36,12 +23,8 @@ fn stt_engine_parses_names_and_backend_aliases() {
}
#[test]
-fn deserializes_with_all_vad_fields_defaulted() {
- // An older config file with none of the Phase 2 keys must still load.
+fn deserializes_with_voice_fields_defaulted() {
let c: VoiceServerConfig = serde_json::from_str("{}").unwrap();
- assert!(!c.always_on_enabled);
// A config file written before the engine selector existed must load.
assert_eq!(c.stt_engine, SttEngine::Backend);
- assert_eq!(c.vad_hangover_ms, default_vad_hangover_ms());
- assert_eq!(c.vad_min_speech_ms, default_vad_min_speech_ms());
}
diff --git a/crates/openhuman-core/src/config/schemas/controllers/voice.rs b/crates/openhuman-core/src/config/schemas/controllers/voice.rs
index 68db644d0c..3a963f3a16 100644
--- a/crates/openhuman-core/src/config/schemas/controllers/voice.rs
+++ b/crates/openhuman-core/src/config/schemas/controllers/voice.rs
@@ -56,27 +56,9 @@ pub(super) fn handle_update_voice_server_settings(
min_duration_secs: update.min_duration_secs,
silence_threshold: update.silence_threshold,
custom_dictionary: update.custom_dictionary,
- always_on_enabled: update.always_on_enabled,
- wake_word: update.wake_word,
stt_engine: update.stt_engine,
};
let result = config_rpc::load_and_apply_voice_server_settings(&ctx, patch).await?;
- // Apply the always-on toggle live (start/idle the capture loop) so the
- // Settings switch takes effect without a restart. Don't fail the RPC if
- // the reload hiccups, but DO surface it — otherwise the saved setting
- // silently wouldn't apply until the next launch.
- match ctx.load_config().await {
- Ok(config) => {
- log::info!("[config][rpc] voice settings saved; applying live always-on state");
- crate::voice::always_on::start_if_enabled(&ctx, &config).await;
- }
- Err(error) => {
- log::warn!(
- "[config][rpc] voice settings saved, but live always-on apply was skipped \
- (config reload failed): {error}"
- );
- }
- }
to_json(result)
})
}
diff --git a/crates/openhuman-core/src/config/schemas/helpers.rs b/crates/openhuman-core/src/config/schemas/helpers.rs
index fcaf49a084..8042d8bbda 100644
--- a/crates/openhuman-core/src/config/schemas/helpers.rs
+++ b/crates/openhuman-core/src/config/schemas/helpers.rs
@@ -185,8 +185,6 @@ pub(super) struct VoiceServerSettingsUpdate {
pub(super) min_duration_secs: Option<f32>,
pub(super) silence_threshold: Option<f32>,
pub(super) custom_dictionary: Option<Vec<String>>,
- pub(super) always_on_enabled: Option<bool>,
- pub(super) wake_word: Option<String>,
pub(super) stt_engine: Option<String>,
}
diff --git a/crates/openhuman-core/src/config/schemas/schema_defs/voice.rs b/crates/openhuman-core/src/config/schemas/schema_defs/voice.rs
index 45bc985f6f..fb731d9d15 100644
--- a/crates/openhuman-core/src/config/schemas/schema_defs/voice.rs
+++ b/crates/openhuman-core/src/config/schemas/schema_defs/voice.rs
@@ -75,14 +75,6 @@ pub(super) fn lookup(function: &str) -> Option<ControllerSchema> {
comment: "Custom vocabulary words to bias the STT engine toward.",
required: false,
},
- optional_bool(
- "always_on_enabled",
- "Continuous always-on listening (no hotkey). Opt-in.",
- ),
- optional_string(
- "wake_word",
- "Always-on wake word; utterances must contain it (default 'Hey Tiny').",
- ),
optional_string(
"stt_engine",
"Hosted speech-to-text engine: backend, elevenlabs, or openai.",