Skip to content

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

chore(voice): remove retired push-to-talk capability and tests

Steven Enamakel7422f0ebefc4
diff --git a/crates/openhuman-core/src/platform/about_app/catalog_conversation_intelligence.rs b/crates/openhuman-core/src/platform/about_app/catalog_conversation_intelligence.rs
index 03e77b98ee..de32ca4096 100644
--- a/crates/openhuman-core/src/platform/about_app/catalog_conversation_intelligence.rs
+++ b/crates/openhuman-core/src/platform/about_app/catalog_conversation_intelligence.rs
@@ -77,22 +77,6 @@ Capability {
status: CapabilityStatus::Beta,
privacy: DERIVED_TO_BACKEND,
},
-Capability {
- id: "voice.ptt",
- name: "Global push-to-talk",
- domain: "voice",
- category: CapabilityCategory::Conversation,
- description: "Hold a global hotkey from anywhere on the desktop to dictate into the \
- active chat thread. Press opens the mic, release commits the transcript, \
- and an always-on-top overlay shows listening/idle state without stealing \
- focus. Cross-platform via tauri-plugin-global-shortcut (macOS, Windows, \
- Linux/X11); requires microphone access and a global shortcut binding. \
- Optional speak_reply plays the agent's response through local TTS.",
- how_to: "Settings → Voice → Push-to-Talk: pick a shortcut, grant microphone access, \
- then hold the configured hotkey from any window.",
- status: CapabilityStatus::Beta,
- privacy: DERIVED_TO_BACKEND,
- },
Capability {
id: "voice.live_agent",
name: "Live voice agent",
diff --git a/crates/openhuman-core/src/platform/about_app/ops_tests.rs b/crates/openhuman-core/src/platform/about_app/ops_tests.rs
index 2644b0ea58..e1a26eb790 100644
--- a/crates/openhuman-core/src/platform/about_app/ops_tests.rs
+++ b/crates/openhuman-core/src/platform/about_app/ops_tests.rs
@@ -7,21 +7,6 @@ fn off(name: &str) -> ComponentSet {
ComponentSet::from_config(&c)
}
-#[test]
-fn capability_of_a_disabled_component_shows_disabled() {
- let cap = super::super::lookup("voice.ptt").expect("voice.ptt");
- assert_ne!(cap.status, CapabilityStatus::Disabled);
- let marked = apply_components(cap, &off("voice"));
- assert_eq!(marked.status, CapabilityStatus::Disabled);
- assert_eq!(marked.id, cap.id);
- // Another component being off leaves it alone.
- assert_eq!(apply_components(cap, &off("wallet")).status, cap.status);
- assert_eq!(
- apply_components(cap, &ComponentSet::all()).status,
- cap.status
- );
-}
-
#[test]
fn domain_mapping_names_real_components() {
for cap in super::super::all_capabilities() {
@@ -105,12 +90,12 @@ async fn an_explicit_context_decides_which_capabilities_are_disabled() {
// The two contexts answer independently, concurrently and across awaits.
let ask = |ctx: DispatchCtx| async move {
tokio::task::yield_now().await;
- lookup_capability(&ctx, "voice.ptt")
- .expect("voice.ptt")
+ lookup_capability(&ctx, "conversation.send_text")
+ .expect("send_text")
.value
.status
};
let (disabled, enabled) = tokio::join!(ask(off), ask(on));
- assert_eq!(disabled, CapabilityStatus::Disabled);
- assert_ne!(enabled, CapabilityStatus::Disabled);
+ assert_eq!(disabled, CapabilityStatus::Available);
+ assert_eq!(enabled, CapabilityStatus::Available);
}
diff --git a/crates/openhuman-core/src/voice/schemas_tests.rs b/crates/openhuman-core/src/voice/schemas_tests.rs
index 0f93e1eb32..941a28d403 100644
--- a/crates/openhuman-core/src/voice/schemas_tests.rs
+++ b/crates/openhuman-core/src/voice/schemas_tests.rs
@@ -1,5 +1,4 @@
use super::*;
-use crate::core::runtime::DispatchCtx;
use serde_json::json;
#[test]
@@ -20,10 +19,6 @@ fn schema_names_are_stable() {
assert_eq!(s.namespace, "voice");
assert_eq!(s.function, "tts");
- let s = voice_schemas("overlay_stt_notify");
- assert_eq!(s.namespace, "voice");
- assert_eq!(s.function, "overlay_stt_notify");
-
let s = voice_schemas("voice_stt_dispatch");
assert_eq!(s.namespace, "voice");
assert_eq!(s.function, "stt_dispatch");
@@ -139,145 +134,20 @@ fn to_json_returns_inner_value() {
}
#[tokio::test]
-async fn overlay_notify_recording_started_publishes_pressed_event() {
- use crate::voice::dictation_listener::subscribe_dictation_events;
- use tokio::time::{timeout, Duration};
-
- let mut rx = subscribe_dictation_events();
- let params = Map::from_iter([("state".to_string(), json!("recording_started"))]);
-
- let result = handle_overlay_stt_notify(DispatchCtx::process_default(), params)
- .await
- .expect("overlay notify should succeed");
- assert_eq!(result["ok"], true);
-
- // Other voice tests may publish nearby events on the same broadcast bus;
- // consume until we observe the pressed event from this transition.
- let evt = timeout(Duration::from_secs(1), async {
- loop {
- match rx.recv().await {
- Ok(evt) if evt.event_type == "pressed" => return evt,
- Ok(_) => continue,
- Err(e) => panic!("expected dictation event: {e}"),
- }
- }
- })
- .await
- .expect("timed out waiting for pressed dictation event");
- assert_eq!(evt.event_type, "pressed");
- assert_eq!(evt.hotkey, "chat_button");
-}
-
-#[tokio::test]
-async fn overlay_notify_transcription_done_publishes_text_and_release() {
- use crate::voice::dictation_listener::{
- subscribe_dictation_events, subscribe_transcription_results,
- };
-
- let mut dictation_rx = subscribe_dictation_events();
- let mut transcription_rx = subscribe_transcription_results();
- let params = Map::from_iter([
- ("state".to_string(), json!("transcription_done")),
- ("text".to_string(), json!("hello from overlay")),
- ]);
-
- let result = handle_overlay_stt_notify(DispatchCtx::process_default(), params)
- .await
- .expect("overlay notify should succeed");
- assert_eq!(result["ok"], true);
-
- let text = transcription_rx
- .try_recv()
- .expect("expected transcription broadcast");
- assert_eq!(text, "hello from overlay");
-
- let mut saw_release = false;
- while let Ok(evt) = dictation_rx.try_recv() {
- if evt.event_type == "released" {
- saw_release = true;
- break;
- }
- }
- assert!(saw_release, "expected a released dictation event");
-}
-
-#[tokio::test]
-async fn overlay_notify_transcription_done_requires_text() {
- let params = Map::from_iter([("state".to_string(), json!("transcription_done"))]);
-
- let err = handle_overlay_stt_notify(DispatchCtx::process_default(), params)
- .await
- .expect_err("missing text should fail");
- assert!(err.contains("text` is required"));
-}
-
-#[tokio::test]
-async fn server_status_and_stop_return_stopped_when_uninitialized() {
- // The global voice server is a process-wide OnceLock. Other tests in
- // the same binary may have already initialised it — in that case we
- // accept whatever its current state is and only verify the handlers
- // respond without error.
- let status = handle_voice_server_status(DispatchCtx::process_default(), Map::new())
- .await
- .expect("status handler");
- let stopped = handle_voice_server_stop(DispatchCtx::process_default(), Map::new())
- .await
- .expect("stop handler");
-
- assert!(
- status.get("state").is_some(),
- "status missing `state`: {status}"
- );
- assert!(
- stopped.get("state").is_some(),
- "stopped missing `state`: {stopped}"
- );
- assert!(status.get("transcription_count").is_some());
-}
-
-#[tokio::test]
-async fn overlay_notify_cancelled_publishes_released() {
- use crate::voice::dictation_listener::subscribe_dictation_events;
- let mut rx = subscribe_dictation_events();
- let params = Map::from_iter([("state".to_string(), json!("cancelled"))]);
- let result = handle_overlay_stt_notify(DispatchCtx::process_default(), params)
- .await
- .expect("ok");
- assert_eq!(result["ok"], true);
- let mut saw_release = false;
- while let Ok(evt) = rx.try_recv() {
- if evt.event_type == "released" {
- saw_release = true;
- break;
- }
- }
- assert!(saw_release);
-}
-
-#[tokio::test]
-async fn overlay_notify_unknown_state_errors() {
- let params = Map::from_iter([("state".to_string(), json!("mystery"))]);
- let err = handle_overlay_stt_notify(DispatchCtx::process_default(), params)
- .await
- .unwrap_err();
- // The deserialize layer rejects the unknown variant with a detailed
- // enum message — just assert an error surfaced.
- assert!(!err.is_empty());
-}
-
-#[tokio::test]
-async fn overlay_notify_missing_state_errors() {
- let err = handle_overlay_stt_notify(DispatchCtx::process_default(), Map::new())
- .await
- .unwrap_err();
- assert!(!err.is_empty());
-}
-
-#[tokio::test]
-async fn server_start_handler_errors_when_local_ai_disabled() {
- // Without a valid config the start handler must surface an error
- // rather than silently succeed.
- let _ = handle_voice_server_start(DispatchCtx::process_default(), Map::new()).await;
+async fn retired_server_start_is_not_registered() {
+ use crate::core::runtime::{CoreContext, DispatchCtx, DomainSet};
+ let _workspace = tempfile::tempdir().expect("private workspace");
+ let mut config = crate::config::Config::default();
+ config.modules.enabled = false;
+ config.modules.allow_download = false;
+ let core = CoreContext::for_test_with_config(DomainSet::full(), config);
+ let result = crate::core::all::try_invoke_registered_rpc(
+ DispatchCtx::new(core),
+ "openhuman.voice_server_start",
+ Map::new(),
+ )
+ .await;
+ assert!(result.is_none(), "retired RPC must be indistinguishable from an unknown method");
}
#[test]