Skip to content

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

refactor(config): remove dictation and voice server settings ops

Steven Enamakela804d73f49f2
diff --git a/crates/openhuman-core/src/config/ops/mod.rs b/crates/openhuman-core/src/config/ops/mod.rs
index e1d71b4d79..cec6facc77 100644
--- a/crates/openhuman-core/src/config/ops/mod.rs
+++ b/crates/openhuman-core/src/config/ops/mod.rs
@@ -75,10 +75,9 @@ pub use search::{
search_settings_json, SearchProviderPatch, SearchSettingsPatch,
};
pub use ui::{
- apply_analytics_settings, apply_browser_settings, apply_user_timezone, get_dictation_settings,
- get_onboarding_completed, get_voice_server_settings, load_and_apply_analytics_settings,
- load_and_apply_browser_settings, load_and_apply_dictation_settings,
- load_and_apply_user_timezone, load_and_apply_voice_server_settings, set_onboarding_completed,
+ apply_analytics_settings, apply_browser_settings, apply_user_timezone,
+ get_onboarding_completed, load_and_apply_analytics_settings,
+ load_and_apply_browser_settings, load_and_apply_user_timezone, set_onboarding_completed,
user_timezone_json, workspace_onboarding_flag_exists, workspace_onboarding_flag_resolve,
workspace_onboarding_flag_set, AnalyticsSettingsPatch, BrowserSettingsPatch,
DictationSettingsPatch, VoiceServerSettingsPatch,
diff --git a/crates/openhuman-core/src/config/ops/ui.rs b/crates/openhuman-core/src/config/ops/ui.rs
index 0cca5539f9..70c71b43a6 100644
--- a/crates/openhuman-core/src/config/ops/ui.rs
+++ b/crates/openhuman-core/src/config/ops/ui.rs
@@ -1,5 +1,5 @@
-//! UI-facing config operations: browser, analytics, dictation, voice server,
-//! onboarding flags. Search settings live in `search.rs`.
+//! UI-facing config operations: browser, analytics, and onboarding flags.
+//! Search settings live in `search.rs`.
use crate::core::runtime::DispatchCtx;
use serde_json::json;
@@ -30,30 +30,6 @@ pub struct AnalyticsSettingsPatch {
pub enabled: Option<bool>,
}
-/// Represents a partial update to dictation-related settings.
-pub struct DictationSettingsPatch {
- pub enabled: Option<bool>,
- pub hotkey: Option<String>,
- pub activation_mode: Option<String>,
- pub llm_refinement: Option<bool>,
- pub streaming: Option<bool>,
- pub streaming_interval_ms: Option<u64>,
-}
-
-/// Represents a partial update to voice server related settings.
-pub struct VoiceServerSettingsPatch {
- pub auto_start: Option<bool>,
- pub hotkey: Option<String>,
- pub activation_mode: Option<String>,
- pub skip_cleanup: Option<bool>,
- pub min_duration_secs: Option<f32>,
- pub silence_threshold: Option<f32>,
- pub custom_dictionary: Option<Vec<String>>,
- /// Hosted STT engine name — `"backend"` / `"elevenlabs"` / `"openai"`
- /// (the `"cloud"` / `"openhuman"` aliases also resolve to backend).
- pub stt_engine: Option<String>,
-}
-
/// Updates the browser-related settings in the configuration.
pub async fn apply_browser_settings(
config: &mut Config,
@@ -381,149 +357,3 @@ pub async fn set_onboarding_completed(
"onboarding_completed saved to config",
))
}
-
-/// Returns the current dictation settings as a JSON object.
-pub async fn get_dictation_settings(
- ctx: &DispatchCtx,
-) -> Result<Outcome<serde_json::Value>, String> {
- let config = ctx.load_config().await?;
- let result = json!({
- "enabled": config.dictation.enabled,
- "hotkey": config.dictation.hotkey,
- "activation_mode": config.dictation.activation_mode,
- "llm_refinement": config.dictation.llm_refinement,
- "streaming": config.dictation.streaming,
- "streaming_interval_ms": config.dictation.streaming_interval_ms,
- });
- Ok(Outcome::new(
- result,
- vec!["dictation settings read".to_string()],
- ))
-}
-
-/// Loads configuration, applies dictation settings updates, and saves it.
-pub async fn load_and_apply_dictation_settings(
- ctx: &DispatchCtx,
- update: DictationSettingsPatch,
-) -> Result<Outcome<serde_json::Value>, String> {
- let mut config = ctx.load_config().await?;
- if let Some(enabled) = update.enabled {
- config.dictation.enabled = enabled;
- }
- if let Some(hotkey) = update.hotkey {
- config.dictation.hotkey = hotkey;
- }
- if let Some(mode) = update.activation_mode {
- match mode.as_str() {
- "toggle" => {
- config.dictation.activation_mode = crate::config::DictationActivationMode::Toggle;
- }
- "push" => {
- config.dictation.activation_mode = crate::config::DictationActivationMode::Push;
- }
- _ => {
- return Err(format!(
- "invalid activation_mode: {mode} (valid: toggle, push)"
- ))
- }
- }
- }
- if let Some(llm_refinement) = update.llm_refinement {
- config.dictation.llm_refinement = llm_refinement;
- }
- if let Some(streaming) = update.streaming {
- config.dictation.streaming = streaming;
- }
- if let Some(interval) = update.streaming_interval_ms {
- config.dictation.streaming_interval_ms = interval;
- }
- config.save().await.map_err(|e| e.to_string())?;
- let snapshot = snapshot_config_json(&config)?;
- Ok(Outcome::new(
- snapshot,
- vec![format!(
- "dictation settings saved to {}",
- config.config_path.display()
- )],
- ))
-}
-
-/// Returns the current voice server settings as a JSON object.
-pub async fn get_voice_server_settings(
- ctx: &DispatchCtx,
-) -> Result<Outcome<serde_json::Value>, String> {
- let config = ctx.load_config().await?;
- let result = json!({
- "auto_start": config.voice_server.auto_start,
- "hotkey": config.voice_server.hotkey,
- "activation_mode": config.voice_server.activation_mode,
- "skip_cleanup": config.voice_server.skip_cleanup,
- "min_duration_secs": config.voice_server.min_duration_secs,
- "silence_threshold": config.voice_server.silence_threshold,
- "custom_dictionary": config.voice_server.custom_dictionary,
- "stt_engine": config.voice_server.stt_engine,
- });
- Ok(Outcome::new(
- result,
- vec!["voice server settings read".to_string()],
- ))
-}
-
-/// Loads configuration, applies voice server settings updates, and saves it.
-pub async fn load_and_apply_voice_server_settings(
- ctx: &DispatchCtx,
- update: VoiceServerSettingsPatch,
-) -> Result<Outcome<serde_json::Value>, String> {
- let mut config = ctx.load_config().await?;
- if let Some(auto_start) = update.auto_start {
- config.voice_server.auto_start = auto_start;
- }
- if let Some(hotkey) = update.hotkey {
- config.voice_server.hotkey = hotkey;
- }
- if let Some(mode) = update.activation_mode {
- match mode.as_str() {
- "tap" => {
- config.voice_server.activation_mode = crate::config::VoiceActivationMode::Tap;
- }
- "push" => {
- config.voice_server.activation_mode = crate::config::VoiceActivationMode::Push;
- }
- _ => {
- return Err(format!(
- "invalid activation_mode: {mode} (valid: tap, push)"
- ))
- }
- }
- }
- if let Some(skip_cleanup) = update.skip_cleanup {
- config.voice_server.skip_cleanup = skip_cleanup;
- }
- if let Some(min_duration_secs) = update.min_duration_secs {
- config.voice_server.min_duration_secs = min_duration_secs.max(0.0);
- }
- if let Some(silence_threshold) = update.silence_threshold {
- config.voice_server.silence_threshold = silence_threshold.max(0.0);
- }
- if let Some(custom_dictionary) = update.custom_dictionary {
- config.voice_server.custom_dictionary = custom_dictionary;
- }
- 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
- // routing to the backend proxy would bill the wrong account.
- let parsed = crate::config::SttEngine::parse(&engine).ok_or_else(|| {
- format!("invalid stt_engine: {engine} (valid: backend, elevenlabs, openai)")
- })?;
- config.voice_server.stt_engine = parsed;
- }
- config.save().await.map_err(|e| e.to_string())?;
- let snapshot = snapshot_config_json(&config)?;
- Ok(Outcome::new(
- snapshot,
- vec![format!(
- "voice server settings saved to {}",
- config.config_path.display()
- )],
- ))
-}
diff --git a/crates/openhuman-core/src/config/schema/load_env_overlay_tests.rs b/crates/openhuman-core/src/config/schema/load_env_overlay_tests.rs
index d3b863c6b6..4976400cbe 100644
--- a/crates/openhuman-core/src/config/schema/load_env_overlay_tests.rs
+++ b/crates/openhuman-core/src/config/schema/load_env_overlay_tests.rs
@@ -343,36 +343,6 @@ fn env_overlay_analytics_enabled_parses_truthy_falsy() {
assert!(!cfg.observability.analytics_enabled);
}
-#[test]
-fn env_overlay_dictation_activation_mode_only_toggle_or_push() {
- let mut cfg = Config::default();
-
- cfg.apply_env_overlay_with(
- &HashMapEnv::new().with("OPENHUMAN_DICTATION_ACTIVATION_MODE", "toggle"),
- );
- assert_eq!(
- cfg.dictation.activation_mode,
- crate::config::DictationActivationMode::Toggle
- );
-
- cfg.apply_env_overlay_with(
- &HashMapEnv::new().with("OPENHUMAN_DICTATION_ACTIVATION_MODE", "push"),
- );
- assert_eq!(
- cfg.dictation.activation_mode,
- crate::config::DictationActivationMode::Push
- );
-
- // Unknown — retains previous value (Push).
- cfg.apply_env_overlay_with(
- &HashMapEnv::new().with("OPENHUMAN_DICTATION_ACTIVATION_MODE", "wave"),
- );
- assert_eq!(
- cfg.dictation.activation_mode,
- crate::config::DictationActivationMode::Push
- );
-}
-
#[test]
fn env_overlay_auto_update_interval_parses_u32() {
let mut cfg = Config::default();
diff --git a/crates/openhuman-core/src/config/schemas/controllers/registry.rs b/crates/openhuman-core/src/config/schemas/controllers/registry.rs
index e2e41ffa2a..cfcd616b35 100644
--- a/crates/openhuman-core/src/config/schemas/controllers/registry.rs
+++ b/crates/openhuman-core/src/config/schemas/controllers/registry.rs
@@ -19,10 +19,6 @@ use super::integrations::{
handle_get_composio_trigger_settings, handle_get_search_settings,
handle_update_composio_trigger_settings, handle_update_search_settings,
};
-use super::voice::{
- handle_get_dictation_settings, handle_get_voice_server_settings,
- handle_update_dictation_settings, handle_update_voice_server_settings,
-};
use super::workspace::{
handle_agent_server_status, handle_get_agent_paths, handle_get_analytics_settings,
handle_get_dashboard_settings, handle_get_data_paths, handle_get_onboarding_completed,
@@ -58,10 +54,6 @@ pub fn all_controller_schemas() -> Vec<ControllerSchema> {
schemas("update_agent_paths"),
schemas("get_onboarding_completed"),
schemas("set_onboarding_completed"),
- schemas("get_dictation_settings"),
- schemas("update_dictation_settings"),
- schemas("get_voice_server_settings"),
- schemas("update_voice_server_settings"),
schemas("update_composio_trigger_settings"),
schemas("get_composio_trigger_settings"),
schemas("get_autonomy_settings"),
diff --git a/crates/openhuman-core/src/config/schemas/mod.rs b/crates/openhuman-core/src/config/schemas/mod.rs
index 3832312c32..d534a3c3be 100644
--- a/crates/openhuman-core/src/config/schemas/mod.rs
+++ b/crates/openhuman-core/src/config/schemas/mod.rs
@@ -27,9 +27,8 @@
//! `get_analytics_settings`, `update_user_timezone`, `get_user_timezone`,
//! `get_dashboard_settings`, `agent_server_status`,
//! `reset_local_data`, `get_data_paths`, `get_agent_paths`, `update_agent_paths`,
-//! `get_onboarding_completed`, `set_onboarding_completed`, `get_dictation_settings`,
-//! `update_dictation_settings`, `get_voice_server_settings`,
-//! `update_voice_server_settings`, `update_composio_trigger_settings`,
+//! `get_onboarding_completed`, `set_onboarding_completed`,
+//! `update_composio_trigger_settings`,
//! `get_composio_trigger_settings`, `get_autonomy_settings`,
//! `update_autonomy_settings`, `get_privacy_mode`, `set_privacy_mode`,
//! `get_agent_settings`, `update_agent_settings`, `update_search_settings`,
diff --git a/crates/openhuman-core/src/config/schemas_tests.rs b/crates/openhuman-core/src/config/schemas_tests.rs
index 2309a48a6d..1117931b9d 100644
--- a/crates/openhuman-core/src/config/schemas_tests.rs
+++ b/crates/openhuman-core/src/config/schemas_tests.rs
@@ -37,10 +37,6 @@ fn every_registered_key_resolves_to_non_unknown_schema() {
"reset_local_data",
"get_onboarding_completed",
"set_onboarding_completed",
- "get_dictation_settings",
- "update_dictation_settings",
- "get_voice_server_settings",
- "update_voice_server_settings",
];
for k in keys {
let s = schemas(k);