Skip to content

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

test(config): remove dictation and voice server settings tests

Steven Enamakel88c8085d629d
diff --git a/crates/openhuman-core/src/config/ops_voice_and_autonomy_tests.rs b/crates/openhuman-core/src/config/ops_voice_and_autonomy_tests.rs
index 02a12e1d7e..0c04bdc708 100644
--- a/crates/openhuman-core/src/config/ops_voice_and_autonomy_tests.rs
+++ b/crates/openhuman-core/src/config/ops_voice_and_autonomy_tests.rs
@@ -13,176 +13,6 @@ async fn get_config_snapshot_wraps_snapshot_in_rpc_outcome() {
.any(|l| l.contains("config loaded from")));
}
-// ── Dictation / voice_server settings patches ─────────────────
-
-#[tokio::test]
-async fn load_and_apply_dictation_settings_rejects_invalid_activation_mode() {
- let _g = ENV_LOCK.lock().await;
- let tmp = tempdir().unwrap();
- unsafe {
- std::env::set_var("OPENHUMAN_WORKSPACE", tmp.path());
- }
- let patch = DictationSettingsPatch {
- enabled: None,
- hotkey: None,
- activation_mode: Some("not-a-mode".into()),
- llm_refinement: None,
- streaming: None,
- streaming_interval_ms: None,
- };
- let err = load_and_apply_dictation_settings(&DispatchCtx::process_default(), patch)
- .await
- .unwrap_err();
- assert!(err.contains("invalid activation_mode"));
- unsafe {
- std::env::remove_var("OPENHUMAN_WORKSPACE");
- }
-}
-
-#[tokio::test]
-async fn load_and_apply_voice_server_settings_rejects_invalid_activation_mode() {
- let _g = ENV_LOCK.lock().await;
- let tmp = tempdir().unwrap();
- unsafe {
- std::env::set_var("OPENHUMAN_WORKSPACE", tmp.path());
- }
- let patch = VoiceServerSettingsPatch {
- auto_start: None,
- hotkey: None,
- activation_mode: Some("hold".into()),
- skip_cleanup: None,
- min_duration_secs: None,
- silence_threshold: None,
- custom_dictionary: None,
- stt_engine: None,
- };
- let err = load_and_apply_voice_server_settings(&DispatchCtx::process_default(), patch)
- .await
- .unwrap_err();
- assert!(err.contains("invalid activation_mode"));
- unsafe {
- std::env::remove_var("OPENHUMAN_WORKSPACE");
- }
-}
-
-#[tokio::test]
-async fn load_and_apply_dictation_settings_accepts_valid_modes() {
- let _g = ENV_LOCK.lock().await;
- let tmp = tempdir().unwrap();
- unsafe {
- std::env::set_var("OPENHUMAN_WORKSPACE", tmp.path());
- }
- for mode in ["toggle", "push"] {
- let patch = DictationSettingsPatch {
- enabled: Some(true),
- hotkey: Some("cmd+d".into()),
- activation_mode: Some(mode.into()),
- llm_refinement: Some(false),
- streaming: Some(false),
- streaming_interval_ms: Some(500),
- };
- assert!(
- load_and_apply_dictation_settings(&DispatchCtx::process_default(), patch)
- .await
- .is_ok(),
- "mode `{mode}` should be accepted"
- );
- }
- unsafe {
- std::env::remove_var("OPENHUMAN_WORKSPACE");
- }
-}
-
-#[tokio::test]
-async fn load_and_apply_voice_server_settings_accepts_valid_modes_and_clamps() {
- let _g = ENV_LOCK.lock().await;
- let tmp = tempdir().unwrap();
- unsafe {
- std::env::set_var("OPENHUMAN_WORKSPACE", tmp.path());
- }
- // Negative min_duration_secs and silence_threshold should be clamped to 0.
- let patch = VoiceServerSettingsPatch {
- auto_start: Some(true),
- hotkey: Some("fn".into()),
- activation_mode: Some("tap".into()),
- skip_cleanup: Some(false),
- min_duration_secs: Some(-5.0),
- silence_threshold: Some(-1.0),
- custom_dictionary: Some(vec!["term".into()]),
- stt_engine: Some("elevenlabs".into()),
- };
- let outcome = load_and_apply_voice_server_settings(&DispatchCtx::process_default(), patch)
- .await
- .expect("ok");
- assert!(
- outcome.value["config"]["voice_server"]["min_duration_secs"]
- .as_f64()
- .unwrap_or(-1.0)
- >= 0.0
- );
- assert_eq!(
- outcome.value["config"]["voice_server"]["stt_engine"]
- .as_str()
- .unwrap_or_default(),
- "elevenlabs",
- "the engine picker must persist through the config update RPC"
- );
- unsafe {
- std::env::remove_var("OPENHUMAN_WORKSPACE");
- }
-}
-
-/// An engine name the core does not know must fail loudly. Defaulting to the
-/// backend proxy would silently transcribe (and bill) somewhere the caller did
-/// not ask for.
-#[tokio::test]
-async fn load_and_apply_voice_server_settings_rejects_unknown_stt_engine() {
- let _g = ENV_LOCK.lock().await;
- let tmp = tempdir().unwrap();
- unsafe {
- std::env::set_var("OPENHUMAN_WORKSPACE", tmp.path());
- }
- let patch = VoiceServerSettingsPatch {
- auto_start: None,
- hotkey: None,
- activation_mode: None,
- skip_cleanup: None,
- min_duration_secs: None,
- silence_threshold: None,
- custom_dictionary: None,
- // The removed local engine is the case that matters: an old client
- // could still send it.
- stt_engine: Some("whisper".into()),
- };
- let err = load_and_apply_voice_server_settings(&DispatchCtx::process_default(), patch)
- .await
- .unwrap_err();
- assert!(err.contains("invalid stt_engine"), "got: {err}");
- unsafe {
- std::env::remove_var("OPENHUMAN_WORKSPACE");
- }
-}
-
-// ── get_* via env override ─────────────────────────────────────
-
-#[tokio::test]
-async fn get_dictation_settings_reads_from_loaded_config() {
- let _g = ENV_LOCK.lock().await;
- let tmp = tempdir().unwrap();
- unsafe {
- std::env::set_var("OPENHUMAN_WORKSPACE", tmp.path());
- }
- let outcome = get_dictation_settings(&DispatchCtx::process_default())
- .await
- .expect("ok");
- assert!(outcome.value.get("enabled").is_some());
- assert!(outcome.value.get("hotkey").is_some());
- assert!(outcome.value.get("streaming_interval_ms").is_some());
- unsafe {
- std::env::remove_var("OPENHUMAN_WORKSPACE");
- }
-}
-
#[tokio::test]
async fn get_onboarding_completed_reads_from_loaded_config() {
let _g = ENV_LOCK.lock().await;