Skip to content

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

test(voice): add coverage for live voice ops and registry

Steven Enamakelb851fac75ed3
diff --git a/crates/openhuman-core/src/voice/live/ops_tests.rs b/crates/openhuman-core/src/voice/live/ops_tests.rs
index 7d86aba60f..d5ca2bbcc1 100644
--- a/crates/openhuman-core/src/voice/live/ops_tests.rs
+++ b/crates/openhuman-core/src/voice/live/ops_tests.rs
@@ -9,7 +9,8 @@ fn providers_and_settings_reflect_the_config() {
providers.default_provider,
config.voice_live.default_provider
);
- assert_eq!(providers.providers.len(), 4);
+ // Only the bring-your-own-key providers are built in; hosted ones register.
+ assert_eq!(providers.providers.len(), 2);
assert_eq!(live_settings_get(&config).value, config.voice_live);
}
diff --git a/crates/openhuman-core/src/voice/live/registry_tests.rs b/crates/openhuman-core/src/voice/live/registry_tests.rs
index c084f34619..02ba564ab1 100644
--- a/crates/openhuman-core/src/voice/live/registry_tests.rs
+++ b/crates/openhuman-core/src/voice/live/registry_tests.rs
@@ -28,10 +28,8 @@ fn entry(label: &str) -> LiveProviderEntry {
fn nothing_registered_lists_only_the_built_in_providers() {
let infos = provider_infos(&Config::default());
let ids: Vec<_> = infos.iter().map(|i| i.id.as_str()).collect();
- assert_eq!(
- ids,
- crate::config::schema::voice_live::LIVE_PROVIDERS.to_vec()
- );
+ // The hosted ids are registered by the hosted-backend layer, not built in.
+ assert_eq!(ids, ["gemini", "sarvam"]);
}
#[test]
diff --git a/crates/openhuman-core/src/voice/ops_tests.rs b/crates/openhuman-core/src/voice/ops_tests.rs
index bbc9cb2dcb..bbdc30dbda 100644
--- a/crates/openhuman-core/src/voice/ops_tests.rs
+++ b/crates/openhuman-core/src/voice/ops_tests.rs
@@ -73,11 +73,11 @@ async fn voice_status_detects_stub_binaries() {
assert!(result.value.piper_binary.is_some());
}
-/// STT is hosted, so status must report it available on a default config
-/// with no local binaries or models anywhere — the state that used to mean
-/// "STT unavailable" back when a whisper.cpp install was required.
+/// The core ships no hosted STT provider: with the hosted-backend layer not
+/// installed, the default `cloud` engine does not resolve, and status says so
+/// instead of claiming a provider that is not there.
#[tokio::test]
-async fn voice_status_reports_backend_stt_available_without_any_local_install() {
+async fn voice_status_reports_the_hosted_engine_unavailable_until_it_is_registered() {
let tmp = tempfile::tempdir().expect("tempdir");
let mut config = Config::default();
config.workspace_dir = tmp.path().join("workspace");
@@ -85,11 +85,11 @@ async fn voice_status_reports_backend_stt_available_without_any_local_install()
let result = voice_status(&config).await.unwrap();
assert!(
- result.value.stt_available,
- "backend engine is always routable"
+ !result.value.stt_available,
+ "no hosted provider is registered in the bare core"
);
assert_eq!(result.value.stt_engine, "cloud");
- assert!(result.value.stt_error.is_none());
+ assert!(result.value.stt_error.is_some());
}
/// Selecting a third-party engine with no matching `voice_providers` entry