Skip to content

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

test(voice): cover disabled voice component in e2e and tidy always-on test

Steven Enamakel221a53561df4
diff --git a/crates/openhuman-core/src/voice/always_on_tests.rs b/crates/openhuman-core/src/voice/always_on_tests.rs
index 7e851573fd..8e6a84a2b5 100644
--- a/crates/openhuman-core/src/voice/always_on_tests.rs
+++ b/crates/openhuman-core/src/voice/always_on_tests.rs
@@ -62,10 +62,9 @@ async fn an_utterance_started_after_stop_never_polls_its_transcription() {
#[tokio::test]
async fn voice_component_off_keeps_always_on_down_even_when_enabled() {
- use std::sync::atomic::Ordering;
let mut config = crate::config::Config::default();
config.voice_server.always_on_enabled = true;
config.components.voice = false;
- super::processor::start_if_enabled(&config).await;
- assert!(!super::processor::ENABLED.load(Ordering::SeqCst));
+ start_if_enabled(&config).await;
+ assert!(!ENABLED.load(Ordering::SeqCst));
}
diff --git a/tests/components_e2e.rs b/tests/components_e2e.rs
index fade89593d..5d95dd8679 100644
--- a/tests/components_e2e.rs
+++ b/tests/components_e2e.rs
@@ -49,6 +49,7 @@ fn disabled_component_answers_component_disabled_over_json_rpc() {
..Config::default()
};
config.components.mcp = false;
+ config.components.voice = false;
tinyhumans_boot::boot();
let _runtime = CoreBuilder::new(HostKind::Library)
.config(config)
@@ -83,6 +84,14 @@ fn disabled_component_answers_component_disabled_over_json_rpc() {
Some("mcp")
);
+ // The voice namespace answers the same typed error.
+ let voice = rpc(&base, "openhuman.voice_status").await;
+ assert_eq!(
+ voice.pointer("/error/message").and_then(Value::as_str),
+ Some("COMPONENT_DISABLED:voice"),
+ "{voice}"
+ );
+
// `modules.list` reports the same module as Disabled, and only it.
let listed = rpc(&base, "openhuman.modules_list").await;
let modules = listed