Skip to content

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

chore: files changed crates/openhuman-core/src/core/bus.rs,crates/openhuman-core/src/core/events.rs,

Steven Enamakela09a48440eed
diff --git a/crates/openhuman-core/src/core/bus.rs b/crates/openhuman-core/src/core/bus.rs
index 6a4172417c..5e875acb11 100644
--- a/crates/openhuman-core/src/core/bus.rs
+++ b/crates/openhuman-core/src/core/bus.rs
@@ -95,7 +95,8 @@ pub const EVENTS_INTERFACE: &str = "ai.tinyhumans.openhuman.Events";
/// `ComposioConnectionCreated` and `ComposioConfigChanged` (additive): a
/// subscriber rebuilds its dispatch context from it instead of reading an
/// ambient one.
-pub const EVENTS_VERSION: Version = Version::new(1, 13, 0);
+/// `2.0.0` removes the unused `Voice::PttTranscriptCommitted` event.
+pub const EVENTS_VERSION: Version = Version::new(2, 0, 0);
/// The bus. Initialised once by [`init`]; safe to touch before that.
pub static BUS: OnceBus<DomainEvent> = OnceBus::new();
diff --git a/crates/openhuman-core/src/core/events.rs b/crates/openhuman-core/src/core/events.rs
index 9797501f1c..6867f8f093 100644
--- a/crates/openhuman-core/src/core/events.rs
+++ b/crates/openhuman-core/src/core/events.rs
@@ -22,21 +22,6 @@
//! path the event is published at, so the broker can filter by domain and never
//! wake a process for events it did not ask for.
-/// Voice-domain events.
-#[non_exhaustive]
-#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
-pub enum VoiceEvent {
- /// A PTT session committed a transcript to a thread. Carries only
- /// length/timing — never the raw text, per the PII-safe logging rule.
- PttTranscriptCommitted {
- thread_id: String,
- session_id: u64,
- text_len: usize,
- held_ms: u64,
- finalized_by_watchdog: bool,
- },
-}
-
/// A tool call made while answering a committed turn: name and id only.
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct ConversationToolCall {
@@ -1270,10 +1255,6 @@ pub enum DomainEvent {
tenant: Option<crate::core::runtime::Tenant>,
},
- // ── Voice ────────────────────────────────────────────────────────────
- /// A voice domain event (PTT, transcription lifecycle, etc.).
- Voice(VoiceEvent),
-
// ── Task sources ─────────────────────────────────────────────────────
/// A task source completed a fetch pass.
TaskSourceFetched {
@@ -1456,8 +1437,6 @@ impl DomainEvent {
| Self::ThreadTodosChanged { .. }
| Self::ThreadRunModeChanged { .. } => "agent",
- Self::Voice(_) => "voice",
-
Self::ApprovalRequested { .. }
| Self::ApprovalDecided { .. }
| Self::ApprovalGateOverrideIgnored { .. }
@@ -1599,7 +1578,6 @@ impl DomainEvent {
Self::ThreadGoalCleared { .. } => "ThreadGoalCleared",
Self::ThreadTodosChanged { .. } => "ThreadTodosChanged",
Self::ThreadRunModeChanged { .. } => "ThreadRunModeChanged",
- Self::Voice(_) => "Voice",
}
}
diff --git a/crates/openhuman-core/src/core/events_tests.rs b/crates/openhuman-core/src/core/events_tests.rs
index a9de36216e..026b78469b 100644
--- a/crates/openhuman-core/src/core/events_tests.rs
+++ b/crates/openhuman-core/src/core/events_tests.rs
@@ -781,19 +781,23 @@ fn a_long_error_is_clipped_on_a_character_boundary() {
/// Every other variant is unchanged: no detail, so its row renders as before.
#[test]
fn events_outside_the_supervisor_have_no_event_log_detail() {
- assert!(DomainEvent::CronJobCompleted {
- job_id: "job-1".into(),
- success: true,
- output: "done".into(),
- }
- .log_detail()
- .is_none());
- assert!(DomainEvent::McpServerConnected {
- server_id: "srv-1".into(),
- tool_count: 25,
- }
- .log_detail()
- .is_none());
+ assert!(
+ DomainEvent::CronJobCompleted {
+ job_id: "job-1".into(),
+ success: true,
+ output: "done".into(),
+ }
+ .log_detail()
+ .is_none()
+ );
+ assert!(
+ DomainEvent::McpServerConnected {
+ server_id: "srv-1".into(),
+ tool_count: 25,
+ }
+ .log_detail()
+ .is_none()
+ );
}
// ── workspace_dir ────────────────────────────────────────────────────────
diff --git a/crates/openhuman-core/src/voice/README.md b/crates/openhuman-core/src/voice/README.md
index 675031e93d..8e077f7c3a 100644
--- a/crates/openhuman-core/src/voice/README.md
+++ b/crates/openhuman-core/src/voice/README.md
@@ -133,11 +133,6 @@ frontend without Tauri-side shortcut registration. The same file starts and
stops TinyVoice's native listener (`start_if_enabled` / `stop`) and normalizes
product hotkey strings before passing them to the module.
-Typed events go through the process-wide `BUS`. [`bus.rs`](./bus.rs) publishes
-`DomainEvent::Voice(VoiceEvent::PttTranscriptCommitted)` with the thread id,
-session id, text length, held milliseconds and a watchdog flag. The raw
-transcript is never included.
-
### Reply speech
`reply_speech::synthesize_reply` posts the agent's reply text to the backend's
diff --git a/crates/openhuman-core/src/voice/bus.rs b/crates/openhuman-core/src/voice/bus.rs
deleted file mode 100644
index 615e9d24fa..0000000000
--- a/crates/openhuman-core/src/voice/bus.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-//! Voice domain event publishers. Publishing the PTT transcript-committed
-//! event here lets downstream subscribers react without coupling to the
-//! channel-web flow.
-
-use crate::core::bus::BUS;
-use crate::core::events::DomainEvent;
-use crate::core::events::VoiceEvent;
-
-/// Publish a [`VoiceEvent::PttTranscriptCommitted`] event.
-pub fn publish_ptt_transcript_committed(
- thread_id: String,
- session_id: u64,
- text_len: usize,
- held_ms: u64,
- finalized_by_watchdog: bool,
-) {
- BUS.publish(DomainEvent::Voice(VoiceEvent::PttTranscriptCommitted {
- thread_id,
- session_id,
- text_len,
- held_ms,
- finalized_by_watchdog,
- }));
-}
-
-#[cfg(test)]
-#[path = "bus_tests.rs"]
-mod tests;
diff --git a/crates/openhuman-core/src/voice/bus_tests.rs b/crates/openhuman-core/src/voice/bus_tests.rs
deleted file mode 100644
index f7b8895159..0000000000
--- a/crates/openhuman-core/src/voice/bus_tests.rs
+++ /dev/null
@@ -1,68 +0,0 @@
-use super::*;
-use crate::core::bus::BUS;
-use crate::core::events::DomainEvent;
-use async_trait::async_trait;
-use std::sync::Arc;
-use tinybus::EventHandler;
-use tokio::sync::Mutex as AsyncMutex;
-
-#[derive(Default)]
-struct Capture {
- events: Arc<AsyncMutex<Vec<VoiceEvent>>>,
-}
-
-#[async_trait]
-impl EventHandler<DomainEvent> for Capture {
- fn name(&self) -> &str {
- "voice::ptt_test_capture"
- }
-
- fn domains(&self) -> Option<&[&str]> {
- Some(&["voice"])
- }
-
- async fn handle(&self, event: &DomainEvent) {
- if let DomainEvent::Voice(v) = event {
- self.events.lock().await.push(v.clone());
- }
- }
-}
-
-#[tokio::test]
-async fn publishing_a_ptt_commit_reaches_a_subscriber() {
- // Use the singleton (init is idempotent).
- crate::core::bus::init().await.expect("bus init");
- let capture = Capture::default();
- let events = capture.events.clone();
- let _sub = BUS.subscribe(Arc::new(capture));
-
- publish_ptt_transcript_committed("thread-1".to_string(), 42, 17, 850, false);
-
- // Give the broadcaster a tick to deliver.
- tokio::time::sleep(std::time::Duration::from_millis(50)).await;
-
- let got = events.lock().await;
- let found = got
- .iter()
- .map(|e| match e {
- VoiceEvent::PttTranscriptCommitted {
- thread_id,
- session_id,
- text_len,
- held_ms,
- finalized_by_watchdog,
- } => (
- thread_id.clone(),
- *session_id,
- *text_len,
- *held_ms,
- *finalized_by_watchdog,
- ),
- })
- .next();
- assert_eq!(
- found,
- Some(("thread-1".to_string(), 42, 17, 850, false)),
- "expected the published event to round-trip with all five fields; got events: {got:?}",
- );
-}
diff --git a/crates/openhuman-core/src/voice/capture_lease.rs b/crates/openhuman-core/src/voice/capture_lease.rs
index 2cfad0e89f..b8d232cb3d 100644
--- a/crates/openhuman-core/src/voice/capture_lease.rs
+++ b/crates/openhuman-core/src/voice/capture_lease.rs
@@ -2,11 +2,11 @@
use super::audio_capture::{RecordingResult, TARGET_SAMPLE_RATE};
use crate::config::Config;
use base64::Engine as _;
-use serde::{de::DeserializeOwned, Serialize};
+use serde::{Serialize, de::DeserializeOwned};
use std::collections::HashMap;
use std::sync::{
- atomic::{AtomicBool, AtomicU64, Ordering},
Arc, LazyLock, Mutex,
+ atomic::{AtomicBool, AtomicU64, Ordering},
};
use tinybus::module::ModuleClient;
use tinyvoice_bus::{
diff --git a/crates/openhuman-core/src/voice/capture_lease_tests.rs b/crates/openhuman-core/src/voice/capture_lease_tests.rs
index 3cd5a28f41..20c40dd4a8 100644
--- a/crates/openhuman-core/src/voice/capture_lease_tests.rs
+++ b/crates/openhuman-core/src/voice/capture_lease_tests.rs
@@ -142,7 +142,7 @@ fn fixture_lease(port: Arc<Fixture>) -> CaptureLease {
#[cfg(feature = "modules")]
#[tokio::test]
async fn capture_never_retries_through_an_unattested_bus() {
- use tinybus::{broker::Broker, transport::memory::MemoryBus, Connection, ObjectPath};
+ use tinybus::{Connection, ObjectPath, broker::Broker, transport::memory::MemoryBus};
#[derive(Clone)]
struct Unattested(Arc<AtomicU64>);
#[tinybus::interface(name = "test.Capture")]
diff --git a/crates/openhuman-core/src/voice/cli.rs b/crates/openhuman-core/src/voice/cli.rs
index 5a7a6620e3..1c5e81ac63 100644
--- a/crates/openhuman-core/src/voice/cli.rs
+++ b/crates/openhuman-core/src/voice/cli.rs
@@ -6,10 +6,10 @@
//! registry pattern because it blocks forever on the hotkey listener, so the
//! adapter lives here inside the voice domain rather than in `crates/openhuman-core/src/core/cli.rs`.
-use anyhow::{anyhow, Result};
+use anyhow::{Result, anyhow};
-use crate::core::logging::{init_for_cli_run, CliLogDefault};
-use crate::voice::server::{run_standalone, VoiceServerConfig};
+use crate::core::logging::{CliLogDefault, init_for_cli_run};
+use crate::voice::server::{VoiceServerConfig, run_standalone};
use tinyvoice_bus::hotkey::ActivationMode;
/// Parse and execute the `openhuman voice` / `openhuman dictate` subcommand.
diff --git a/crates/openhuman-core/src/voice/factory/entry.rs b/crates/openhuman-core/src/voice/factory/entry.rs
index a23c671e5c..55f4d59db3 100644
--- a/crates/openhuman-core/src/voice/factory/entry.rs
+++ b/crates/openhuman-core/src/voice/factory/entry.rs
@@ -3,7 +3,7 @@
use log::debug;
use super::helpers::{
- create_stt_provider_by_slug, create_tts_provider_by_slug, split_slug_model, LOG_PREFIX,
+ LOG_PREFIX, create_stt_provider_by_slug, create_tts_provider_by_slug, split_slug_model,
};
use super::registry::{stt_factory, tts_factory};
use super::traits::{SttProvider, TtsProvider};
diff --git a/crates/openhuman-core/src/voice/factory/factory_tests.rs b/crates/openhuman-core/src/voice/factory/factory_tests.rs
index ace2584fa2..cba764c353 100644
--- a/crates/openhuman-core/src/voice/factory/factory_tests.rs
+++ b/crates/openhuman-core/src/voice/factory/factory_tests.rs
@@ -1,12 +1,12 @@
//! Unit tests for the voice factory.
use super::entry::{
- create_stt_provider, create_tts_provider, resolve_tts_voice, DEFAULT_PIPER_VOICE,
+ DEFAULT_PIPER_VOICE, create_stt_provider, create_tts_provider, resolve_tts_voice,
};
use super::helpers::{effective_stt_provider, effective_tts_provider, split_slug_model};
-use crate::config::schema::voice_providers::VoiceCapability;
-use crate::config::schema::SttEngine;
use crate::config::Config;
+use crate::config::schema::SttEngine;
+use crate::config::schema::voice_providers::VoiceCapability;
use tinyinference_voice::external_stt::SttApiStyle;
fn cfg() -> Config {
diff --git a/crates/openhuman-core/src/voice/factory/mod.rs b/crates/openhuman-core/src/voice/factory/mod.rs
index 23c0da8de6..546bf4486c 100644
--- a/crates/openhuman-core/src/voice/factory/mod.rs
+++ b/crates/openhuman-core/src/voice/factory/mod.rs
@@ -54,7 +54,7 @@ mod tts_providers;
mod tests;
// Re-export the public API — exact visibility preserved from the original file.
-pub use entry::{create_stt_provider, create_tts_provider, DEFAULT_PIPER_VOICE, DEFAULT_STT_MODEL};
+pub use entry::{DEFAULT_PIPER_VOICE, DEFAULT_STT_MODEL, create_stt_provider, create_tts_provider};
pub use helpers::{effective_stt_provider, effective_tts_provider};
pub use stt_providers::ExternalSttProvider;
pub use traits::{SttProvider, SttResult, TtsProvider};
diff --git a/crates/openhuman-core/src/voice/factory/tts_providers.rs b/crates/openhuman-core/src/voice/factory/tts_providers.rs
index 3a817aaab9..86abea7a60 100644
--- a/crates/openhuman-core/src/voice/factory/tts_providers.rs
+++ b/crates/openhuman-core/src/voice/factory/tts_providers.rs
@@ -4,7 +4,7 @@
use async_trait::async_trait;
use log::debug;
-use super::super::local_speech::{synthesize_piper, PiperOptions};
+use super::super::local_speech::{PiperOptions, synthesize_piper};
use super::traits::TtsProvider;
use crate::config::Config;
use crate::core::Outcome;
diff --git a/crates/openhuman-core/src/voice/live/mod.rs b/crates/openhuman-core/src/voice/live/mod.rs
index 88257b6bde..5e3fd84a9f 100644
--- a/crates/openhuman-core/src/voice/live/mod.rs
+++ b/crates/openhuman-core/src/voice/live/mod.rs
@@ -28,5 +28,5 @@ pub mod types;
pub mod ws;
pub use error::LiveVoiceError;
-pub use providers::{PreparedProvider, GEMINI_LANGUAGES, GEMINI_VOICES};
+pub use providers::{GEMINI_LANGUAGES, GEMINI_VOICES, PreparedProvider};
pub use schemas::{live_controller_schemas, live_registered_controllers, live_schemas};
diff --git a/crates/openhuman-core/src/voice/live/ops.rs b/crates/openhuman-core/src/voice/live/ops.rs
index 8e041620cf..eb98203966 100644
--- a/crates/openhuman-core/src/voice/live/ops.rs
+++ b/crates/openhuman-core/src/voice/live/ops.rs
@@ -11,8 +11,8 @@ use super::types::{
GeminiLiveSettingsPatch, LiveProvidersResponse, LiveSettingsPatch, LiveTestResult,
LiveVoiceConfig, SarvamLiveSettingsPatch,
};
-use crate::config::schema::voice_live::is_live_provider;
use crate::config::Config;
+use crate::config::schema::voice_live::is_live_provider;
use crate::core::Outcome;
/// How long a provider test waits for the session to become ready.
diff --git a/crates/openhuman-core/src/voice/live/providers.rs b/crates/openhuman-core/src/voice/live/providers.rs
index 7804cf9bed..9166100135 100644
--- a/crates/openhuman-core/src/voice/live/providers.rs
+++ b/crates/openhuman-core/src/voice/live/providers.rs
@@ -20,10 +20,10 @@ use tinyagents_live::tinyliveagents::{AudioFormat, LiveConfig, LiveProvider};
use super::error::LiveVoiceError;
use super::types::{LiveProviderInfo, LiveProviderKind};
+use crate::config::Config;
use crate::config::schema::voice_live::{
- LIVE_PROVIDERS, LIVE_PROVIDER_GEMINI, LIVE_PROVIDER_SARVAM,
+ LIVE_PROVIDER_GEMINI, LIVE_PROVIDER_SARVAM, LIVE_PROVIDERS,
};
-use crate::config::Config;
const LOG_PREFIX: &str = "[voice-live]";
diff --git a/crates/openhuman-core/src/voice/live/providers_tests.rs b/crates/openhuman-core/src/voice/live/providers_tests.rs
index 68eb5dee7e..f3af03fe0c 100644
--- a/crates/openhuman-core/src/voice/live/providers_tests.rs
+++ b/crates/openhuman-core/src/voice/live/providers_tests.rs
@@ -1,6 +1,6 @@
use super::*;
use crate::config::schema::voice_live::{
- LIVE_PROVIDERS, LIVE_PROVIDER_ELEVENLABS_HOSTED, LIVE_PROVIDER_GEMINI_HOSTED,
+ LIVE_PROVIDER_ELEVENLABS_HOSTED, LIVE_PROVIDER_GEMINI_HOSTED, LIVE_PROVIDERS,
};
#[test]
@@ -41,10 +41,12 @@ fn live_config_follows_the_settings_per_provider() {
assert_eq!(gemini.system_instruction.as_deref(), Some("prompt"));
assert_eq!(gemini.voice.as_deref(), Some("Kore"));
assert_eq!(gemini.model.as_deref(), Some("gemini-x"));
- assert!(gemini
- .provider_options
- .get("context_window_compression")
- .is_some());
+ assert!(
+ gemini
+ .provider_options
+ .get("context_window_compression")
+ .is_some()
+ );
let sarvam = live_config(&config, LIVE_PROVIDER_SARVAM, "prompt", 8_000);
assert_eq!(sarvam.voice.as_deref(), Some("priya"));
diff --git a/crates/openhuman-core/src/voice/live/schemas.rs b/crates/openhuman-core/src/voice/live/schemas.rs
index 385ff181cc..118c794191 100644
--- a/crates/openhuman-core/src/voice/live/schemas.rs
+++ b/crates/openhuman-core/src/voice/live/schemas.rs
@@ -36,8 +36,7 @@ pub fn live_schemas(function: &str) -> ControllerSchema {
"voice_live_providers" => ControllerSchema {
namespace: "voice",
function: "live_providers",
- description:
- "List live voice agent providers, whether each is usable, and the default.",
+ description: "List live voice agent providers, whether each is usable, and the default.",
inputs: vec![],
outputs: vec![
json_output("default_provider", "The provider Tiny uses by default."),
@@ -88,8 +87,7 @@ pub fn live_schemas(function: &str) -> ControllerSchema {
"voice_live_test_provider" => ControllerSchema {
namespace: "voice",
function: "live_test_provider",
- description:
- "Open a live session on a provider, wait until it is ready, then close it.",
+ description: "Open a live session on a provider, wait until it is ready, then close it.",
inputs: vec![FieldSchema {
name: "provider",
ty: TypeSchema::String,
diff --git a/crates/openhuman-core/src/voice/live/schemas_tests.rs b/crates/openhuman-core/src/voice/live/schemas_tests.rs
index 8f8650ea09..ada9b2b674 100644
--- a/crates/openhuman-core/src/voice/live/schemas_tests.rs
+++ b/crates/openhuman-core/src/voice/live/schemas_tests.rs
@@ -18,10 +18,11 @@ fn registers_four_live_controllers_in_the_voice_namespace() {
assert_eq!(live_controller_schemas().len(), 4);
assert_eq!(live_schemas("missing").function, "unknown");
let test = live_schemas("voice_live_test_provider");
- assert!(test
- .inputs
- .iter()
- .any(|f| f.name == "provider" && f.required));
+ assert!(
+ test.inputs
+ .iter()
+ .any(|f| f.name == "provider" && f.required)
+ );
}
#[tokio::test]
@@ -32,10 +33,12 @@ async fn handlers_reject_bad_params() {
.await
.is_err()
);
- assert!(handle_live_settings_set(
- DispatchCtx::process_default(),
- bad(serde_json::json!({"gemini": 5}))
- )
- .await
- .is_err());
+ assert!(
+ handle_live_settings_set(
+ DispatchCtx::process_default(),
+ bad(serde_json::json!({"gemini": 5}))
+ )
+ .await
+ .is_err()
+ );
}
diff --git a/crates/openhuman-core/src/voice/live/session.rs b/crates/openhuman-core/src/voice/live/session.rs
index f050ffd536..a6b23300b2 100644
--- a/crates/openhuman-core/src/voice/live/session.rs
+++ b/crates/openhuman-core/src/voice/live/session.rs
@@ -17,11 +17,11 @@ use super::error::LiveVoiceError;
use super::providers;
use crate::agent::session_host::OpenHumanSessionHost;
use crate::agent::tinyagents::host::OpenHumanRunContext;
-use crate::agent::tinyagents::live_harness::{assemble_live_tool_harness, LIVE_MAX_TOOL_CALLS};
-use crate::config::schema::voice_live::is_live_provider;
+use crate::agent::tinyagents::live_harness::{LIVE_MAX_TOOL_CALLS, assemble_live_tool_harness};
use crate::config::Config;
+use crate::config::schema::voice_live::is_live_provider;
use crate::security::approval::{ApprovalChatContext, ApprovalTurnContext};
-use crate::security::turn_origin::{with_origin, AgentTurnOrigin};
+use crate::security::turn_origin::{AgentTurnOrigin, with_origin};
use crate::threads::store::{ConversationMessage, CreateConversationThread};
/// The agent a live session borrows its tools from.
diff --git a/crates/openhuman-core/src/voice/live/ws.rs b/crates/openhuman-core/src/voice/live/ws.rs
index 539473ef51..484b0b6a18 100644
--- a/crates/openhuman-core/src/voice/live/ws.rs
+++ b/crates/openhuman-core/src/voice/live/ws.rs
@@ -15,8 +15,8 @@ use std::time::Duration;
use axum::extract::ws::{Message, WebSocket};
use bytes::Bytes;
use futures::{SinkExt, StreamExt};
-use tinyagents_live::tinyliveagents::{CloseReason, LiveEvent};
use tinyagents_live::LiveAgentEvent;
+use tinyagents_live::tinyliveagents::{CloseReason, LiveEvent};
use super::error::LiveVoiceError;
use super::persist::TranscriptPersister;
diff --git a/crates/openhuman-core/src/voice/live/ws_tests.rs b/crates/openhuman-core/src/voice/live/ws_tests.rs
index a25b5a5fbc..5c014249bc 100644
--- a/crates/openhuman-core/src/voice/live/ws_tests.rs
+++ b/crates/openhuman-core/src/voice/live/ws_tests.rs
@@ -112,12 +112,14 @@ fn maps_audio_turns_errors_and_closes() {
matches!(&out[0], Outbound::Json(ServerFrame::Error { code, fatal: true, .. }) if code == "unauthorized")
);
// Tool calls surface through ToolStarted/ToolFinished instead.
- assert!(map(LiveEvent::ToolCall(ToolCall {
- call_id: "c".into(),
- name: "n".into(),
- args: serde_json::json!({})
- }))
- .is_empty());
+ assert!(
+ map(LiveEvent::ToolCall(ToolCall {
+ call_id: "c".into(),
+ name: "n".into(),
+ args: serde_json::json!({})
+ }))
+ .is_empty()
+ );
}
#[test]
diff --git a/crates/openhuman-core/src/voice/local_speech.rs b/crates/openhuman-core/src/voice/local_speech.rs
index 6ce7e3117b..0382362821 100644
--- a/crates/openhuman-core/src/voice/local_speech.rs
+++ b/crates/openhuman-core/src/voice/local_speech.rs
@@ -2,10 +2,10 @@
use crate::config::Config;
use crate::core::Outcome;
+use tinyinference_voice::VisemeFrame;
#[cfg(test)]
use tinyinference_voice::piper::synthetic_viseme_timeline;
use tinyinference_voice::reply::ReplySpeech as ReplySpeechResult;
-use tinyinference_voice::VisemeFrame;
/// Default Piper voice id.
pub const DEFAULT_PIPER_VOICE: &str = "en_US-lessac-medium";
diff --git a/crates/openhuman-core/src/voice/mod.rs b/crates/openhuman-core/src/voice/mod.rs
index 81de2c1208..9293a5b6c6 100644
--- a/crates/openhuman-core/src/voice/mod.rs
+++ b/crates/openhuman-core/src/voice/mod.rs
@@ -16,8 +16,8 @@
//! off, [`stub`] takes its place and exposes the same public surface that
//! other-gated callers depend on (`server`, `dictation_listener`,
//! `create_stt_provider`,
-//! `effective_stt_provider`, `publish_ptt_transcript_committed`) with
-//! no-op / disabled-error bodies. Keeping the two surfaces in lockstep is
+//! `effective_stt_provider`) with no-op / disabled-error bodies. Keeping the
+//! two surfaces in lockstep is
//! enforced by the disabled-build check
//! (`cargo check --no-default-features --features "<all-but-voice>"`): any
//! signature drift fails that build.
@@ -31,12 +31,8 @@ pub use compile_status::VOICE_COMPILED_IN;
#[cfg(feature = "voice")]
pub mod audio_capture;
#[cfg(feature = "voice")]
-pub mod bus;
-#[cfg(feature = "voice")]
pub(crate) mod capture_lease;
#[cfg(feature = "voice")]
-pub use bus::publish_ptt_transcript_committed;
-#[cfg(feature = "voice")]
pub(crate) mod cli;
#[cfg(feature = "voice")]
pub mod dictation_listener;
@@ -61,9 +57,9 @@ pub mod local_speech;
pub mod postprocess;
#[cfg(feature = "voice")]
pub use factory::{
- create_stt_provider, create_tts_provider, effective_stt_provider, effective_tts_provider,
- ExternalSttProvider, ExternalTtsProvider, SttProvider, SttResult, TtsProvider,
- DEFAULT_PIPER_VOICE, DEFAULT_STT_MODEL,
+ DEFAULT_PIPER_VOICE, DEFAULT_STT_MODEL, ExternalSttProvider, ExternalTtsProvider, SttProvider,
+ SttResult, TtsProvider, create_stt_provider, create_tts_provider, effective_stt_provider,
+ effective_tts_provider,
};
#[cfg(feature = "voice")]
pub use ops::*;
diff --git a/crates/openhuman-core/src/voice/ops.rs b/crates/openhuman-core/src/voice/ops.rs
index 506ac35e65..cf48e3e4a7 100644
--- a/crates/openhuman-core/src/voice/ops.rs
+++ b/crates/openhuman-core/src/voice/ops.rs
@@ -15,7 +15,7 @@ use tinyinference_local::models as model_ids;
use super::factory::{create_stt_provider, effective_stt_provider};
use super::postprocess;
use super::types::{VoiceSpeechResult, VoiceStatus, VoiceTtsResult};
-use crate::modules::voice::{is_hallucinated, HallucinationMode};
+use crate::modules::voice::{HallucinationMode, is_hallucinated};
const LOG_PREFIX: &str = "[voice]";
diff --git a/crates/openhuman-core/src/voice/ops_tests.rs b/crates/openhuman-core/src/voice/ops_tests.rs
index bbdc30dbda..7396ffccd8 100644
--- a/crates/openhuman-core/src/voice/ops_tests.rs
+++ b/crates/openhuman-core/src/voice/ops_tests.rs
@@ -128,10 +128,12 @@ async fn voice_status_reports_external_engine_without_credentials_as_unavailable
let status = voice_status(&config).await.unwrap().value;
assert!(!status.stt_available);
- assert!(status
- .stt_error
- .as_deref()
- .is_some_and(|error| error.contains("no API credential")));
+ assert!(
+ status
+ .stt_error
+ .as_deref()
+ .is_some_and(|error| error.contains("no API credential"))
+ );
}
#[test]
diff --git a/crates/openhuman-core/src/voice/realtime_harness.rs b/crates/openhuman-core/src/voice/realtime_harness.rs
index 1a70f29c2a..46aeb7b911 100644
--- a/crates/openhuman-core/src/voice/realtime_harness.rs
+++ b/crates/openhuman-core/src/voice/realtime_harness.rs
@@ -32,11 +32,11 @@ pub use turn_handler::handle_voice_harness_turn;
use crate::progress::AgentProgress;
#[cfg(test)]
use prompt::{
- is_answerable_prompt, is_content_free, messages_to_history_pairs, readback_payload,
- should_arm_speak_back, spoken_delta, VOICE_READBACK_PREFIX,
+ VOICE_READBACK_PREFIX, is_answerable_prompt, is_content_free, messages_to_history_pairs,
+ readback_payload, should_arm_speak_back, spoken_delta,
};
#[cfg(test)]
-use turn_handler::{next_handoff_line, VOICE_HANDOFF_LINES};
+use turn_handler::{VOICE_HANDOFF_LINES, next_handoff_line};
#[cfg(test)]
#[path = "realtime_harness_tests.rs"]
diff --git a/crates/openhuman-core/src/voice/realtime_harness/agent.rs b/crates/openhuman-core/src/voice/realtime_harness/agent.rs
index 2aee6f6749..9a6811dd14 100644
--- a/crates/openhuman-core/src/voice/realtime_harness/agent.rs
+++ b/crates/openhuman-core/src/voice/realtime_harness/agent.rs
@@ -10,7 +10,7 @@ use serde_json::Value;
use crate::agent::session_host::OpenHumanSessionHost;
use crate::progress::AgentProgress;
-use crate::security::turn_origin::{with_origin, AgentTurnOrigin};
+use crate::security::turn_origin::{AgentTurnOrigin, with_origin};
use super::chat_delivery::{VOICE_CHAT_CLIENT_ID, VOICE_CHAT_THREAD_ID};
use super::prompt::messages_to_history_pairs;
diff --git a/crates/openhuman-core/src/voice/realtime_harness/chat_delivery.rs b/crates/openhuman-core/src/voice/realtime_harness/chat_delivery.rs
index 69954b3c8e..385e376ceb 100644
--- a/crates/openhuman-core/src/voice/realtime_harness/chat_delivery.rs
+++ b/crates/openhuman-core/src/voice/realtime_harness/chat_delivery.rs
@@ -3,7 +3,7 @@
//! relay.
use log::{info, warn};
-use serde_json::{json, Value};
+use serde_json::{Value, json};
use crate::platform::socket::manager::global_socket_manager;
diff --git a/crates/openhuman-core/src/voice/realtime_harness/turn_handler.rs b/crates/openhuman-core/src/voice/realtime_harness/turn_handler.rs
index bcccddeac9..8212899873 100644
--- a/crates/openhuman-core/src/voice/realtime_harness/turn_handler.rs
+++ b/crates/openhuman-core/src/voice/realtime_harness/turn_handler.rs
@@ -8,7 +8,7 @@ use std::sync::{Arc, LazyLock, Mutex};
use std::time::Duration;
use log::{info, warn};
-use serde_json::{json, Value};
+use serde_json::{Value, json};
use tokio::sync::Semaphore;
use crate::progress::AgentProgress;
@@ -175,7 +175,9 @@ pub async fn handle_voice_harness_turn(
// answer nothing — and its empty reply surfaced in chat as a failure notice
// the user never asked for.
if is_content_free(&prompt) {
- info!("[voice-harness] ignoring content-free turn correlation={correlation_id} prompt={prompt:?}");
+ info!(
+ "[voice-harness] ignoring content-free turn correlation={correlation_id} prompt={prompt:?}"
+ );
emit_event(
"voice:harness:delta",
json!({ "correlationId": correlation_id, "text": VOICE_SILENT_REPLY }),
@@ -192,7 +194,9 @@ pub async fn handle_voice_harness_turn(
// Deduplicate a re-delivered turn (relay retry) before doing any work. Owned
// so it can move into the background continuation and track the real turn.
let Some(in_flight) = InFlightGuard::claim(&correlation_id) else {
- warn!("[voice-harness] duplicate turn correlation={correlation_id} already in flight — dropping");
+ warn!(
+ "[voice-harness] duplicate turn correlation={correlation_id} already in flight — dropping"
+ );
return;
};
@@ -252,7 +256,9 @@ pub async fn handle_voice_harness_turn(
if should_arm_speak_back(&turn_prompt) {
deliver_voice_result_to_chat(&turn_cid, reply, true);
} else {
- info!("[voice-harness] deferred read-back turn carries no new content; skipping chat delivery correlation={turn_cid}");
+ info!(
+ "[voice-harness] deferred read-back turn carries no new content; skipping chat delivery correlation={turn_cid}"
+ );
}
}
Err(err) => {
@@ -344,7 +350,9 @@ pub async fn handle_voice_harness_turn(
// takes the chat-delivery path. The forwarder is left running to keep
// draining progress — any late deltas reach a settled relay turn and
// are dropped harmlessly.
- info!("[voice-harness] ack deadline reached, handing off to chat correlation={correlation_id}");
+ info!(
+ "[voice-harness] ack deadline reached, handing off to chat correlation={correlation_id}"
+ );
// If the turn never said anything of its own, the caller has heard only
// the relay's filler. Ending there sounds like the assistant lost the
// thread, so say the answer is still coming — it is, on both delivery
diff --git a/crates/openhuman-core/src/voice/schemas/handlers/provider_server.rs b/crates/openhuman-core/src/voice/schemas/handlers/provider_server.rs
index 41bca07ded..da1b86d9ec 100644
--- a/crates/openhuman-core/src/voice/schemas/handlers/provider_server.rs
+++ b/crates/openhuman-core/src/voice/schemas/handlers/provider_server.rs
@@ -87,7 +87,7 @@ pub(crate) fn handle_voice_update_provider_settings(
) -> ControllerFuture {
Box::pin(async move {
use crate::config::schema::voice_providers::{
- generate_voice_provider_id, is_voice_slug_reserved, VoiceCapability, VoiceProviderCreds,
+ VoiceCapability, VoiceProviderCreds, generate_voice_provider_id, is_voice_slug_reserved,
};
use tinyinference_voice::external_stt::SttApiStyle;
use tinyinference_voice::external_tts::TtsApiStyle;
@@ -113,7 +113,7 @@ pub(crate) fn handle_voice_update_provider_settings(
Some(other) => {
return Err(format!(
"invalid capability '{other}' (valid: 'stt', 'tts', 'both')"
- ))
+ ));
}
};
@@ -122,8 +122,8 @@ pub(crate) fn handle_voice_update_provider_settings(
Some("none") => crate::config::schema::AuthStyle::None,
Some(other) => {
return Err(format!(
- "invalid auth_style '{other}' for voice provider (valid: 'bearer', 'none')"
- ))
+ "invalid auth_style '{other}' for voice provider (valid: 'bearer', 'none')"
+ ));
}
};
@@ -134,7 +134,7 @@ pub(crate) fn handle_voice_update_provider_settings(
Some(other) => {
return Err(format!(
"invalid stt_api_style '{other}' (valid: 'openai_audio', 'deepgram', 'elevenlabs')"
- ))
+ ));
}
};
@@ -144,7 +144,7 @@ pub(crate) fn handle_voice_update_provider_settings(
Some(other) => {
return Err(format!(
"invalid tts_api_style '{other}' (valid: 'openai_audio', 'elevenlabs')"
- ))
+ ));
}
};
@@ -428,7 +428,7 @@ pub(crate) fn handle_voice_server_start(
params: Map<String, Value>,
) -> ControllerFuture {
Box::pin(async move {
- use crate::voice::server::{global_server, VoiceServerConfig};
+ use crate::voice::server::{VoiceServerConfig, global_server};
use tinyvoice_bus::hotkey::ActivationMode;
let config = ctx.load_config().await?;
@@ -576,7 +576,7 @@ pub(crate) fn handle_overlay_stt_notify(
);
use crate::voice::dictation_listener::{
- publish_dictation_event, publish_transcription, DictationEvent,
+ DictationEvent, publish_dictation_event, publish_transcription,
};
match p.state {
diff --git a/crates/openhuman-core/src/voice/schemas/registry.rs b/crates/openhuman-core/src/voice/schemas/registry.rs
index 5e4fe0090f..7f1401589f 100644
--- a/crates/openhuman-core/src/voice/schemas/registry.rs
+++ b/crates/openhuman-core/src/voice/schemas/registry.rs
@@ -115,8 +115,7 @@ pub fn voice_schemas(function: &str) -> ControllerSchema {
"voice_transcribe" => ControllerSchema {
namespace: "voice",
function: "transcribe",
- description:
- "Transcribe audio from a file path through the configured STT engine, with optional LLM cleanup.",
+ description: "Transcribe audio from a file path through the configured STT engine, with optional LLM cleanup.",
inputs: vec![
required_string("audio_path", "Path to the audio file."),
optional_string("context", "Conversation context for LLM post-processing."),
@@ -133,8 +132,7 @@ pub fn voice_schemas(function: &str) -> ControllerSchema {
"voice_transcribe_bytes" => ControllerSchema {
namespace: "voice",
function: "transcribe_bytes",
- description:
- "Transcribe audio from raw bytes through the configured STT engine, with optional LLM cleanup.",
+ description: "Transcribe audio from raw bytes through the configured STT engine, with optional LLM cleanup.",
inputs: vec![
FieldSchema {
name: "audio_bytes",
@@ -167,8 +165,7 @@ pub fn voice_schemas(function: &str) -> ControllerSchema {
"voice_reply_synthesize" => ControllerSchema {
namespace: "voice",
function: "reply_synthesize",
- description:
- "Synthesize an agent reply via the hosted backend (ElevenLabs) and return \
+ description: "Synthesize an agent reply via the hosted backend (ElevenLabs) and return \
base64 audio plus an Oculus-15 viseme alignment for mascot lip-sync.",
inputs: vec![
required_string("text", "Text to synthesize."),
@@ -187,8 +184,7 @@ pub fn voice_schemas(function: &str) -> ControllerSchema {
"voice_stt_dispatch" => ControllerSchema {
namespace: "voice",
function: "stt_dispatch",
- description:
- "Factory-dispatched speech-to-text. Routes to the OpenHuman backend proxy or a \
+ description: "Factory-dispatched speech-to-text. Routes to the OpenHuman backend proxy or a \
third-party provider based on `provider` (or, when unspecified, the resolved \
`voice_server.stt_engine`). Returns the same `{ text }` payload either way.",
inputs: vec![
@@ -200,21 +196,20 @@ pub fn voice_schemas(function: &str) -> ControllerSchema {
"provider",
"Override provider: 'cloud' or '<slug>[:<model>]'. Defaults to the resolved voice_server.stt_engine.",
),
- optional_string("model", "Model id for the selected engine (e.g. 'scribe_v1', 'whisper-1')."),
+ optional_string(
+ "model",
+ "Model id for the selected engine (e.g. 'scribe_v1', 'whisper-1').",
+ ),
optional_string("mime_type", "Audio MIME type (default: audio/webm)."),
optional_string("file_name", "Filename hint (default: audio.webm)."),
optional_string("language", "BCP-47 language hint, e.g. 'en'."),
],
- outputs: vec![json_output(
- "result",
- "SttResult: { text, provider }.",
- )],
+ outputs: vec![json_output("result", "SttResult: { text, provider }.")],
},
"voice_tts_dispatch" => ControllerSchema {
namespace: "voice",
function: "tts_dispatch",
- description:
- "Factory-dispatched text-to-speech. Routes to the cloud ElevenLabs proxy \
+ description: "Factory-dispatched text-to-speech. Routes to the cloud ElevenLabs proxy \
(returns rich viseme alignment) or local Piper (returns audio + a synthetic \
viseme timeline) based on `provider` (or `config.local_ai.tts_provider`).",
inputs: vec![
@@ -236,8 +231,7 @@ pub fn voice_schemas(function: &str) -> ControllerSchema {
"voice_set_providers" => ControllerSchema {
namespace: "voice",
function: "set_providers",
- description:
- "Persist the STT / TTS provider selection (and optional model/voice id) into \
+ description: "Persist the STT / TTS provider selection (and optional model/voice id) into \
`config.local_ai.{stt,tts}_provider` so subsequent voice_stt_dispatch / \
voice_tts_dispatch calls resolve without an explicit provider param.",
inputs: vec![
@@ -260,8 +254,7 @@ pub fn voice_schemas(function: &str) -> ControllerSchema {
"voice_update_provider_settings" => ControllerSchema {
namespace: "voice",
function: "update_provider_settings",
- description:
- "Persist the voice provider registry and STT/TTS routing strings. \
+ description: "Persist the voice provider registry and STT/TTS routing strings. \
Mirrors openhuman.inference_update_model_settings for the voice domain.",
inputs: vec![
FieldSchema {
@@ -287,8 +280,7 @@ pub fn voice_schemas(function: &str) -> ControllerSchema {
"voice_list_models" => ControllerSchema {
namespace: "voice",
function: "list_models",
- description:
- "List available models or voices for a voice provider. Returns static \
+ description: "List available models or voices for a voice provider. Returns static \
presets for built-in slugs; probes /models for custom providers.",
inputs: vec![
required_string("provider_id", "Provider id or slug."),
@@ -297,16 +289,12 @@ pub fn voice_schemas(function: &str) -> ControllerSchema {
"Filter by capability: 'stt' or 'tts'. Defaults to both.",
),
],
- outputs: vec![json_output(
- "models",
- "{ models: [{ id, label? }] }",
- )],
+ outputs: vec![json_output("models", "{ models: [{ id, label? }] }")],
},
"voice_test_provider" => ControllerSchema {
namespace: "voice",
function: "test_provider",
- description:
- "Test a voice provider endpoint without saving. STT transcribes a \
+ description: "Test a voice provider endpoint without saving. STT transcribes a \
silent audio clip; TTS synthesizes 'Hello' and discards. With \
`validate_only` it is a dry run: a lightweight authenticated GET, \
no inference call and nothing persisted.",
@@ -336,8 +324,7 @@ pub fn voice_schemas(function: &str) -> ControllerSchema {
"voice_server_start" => ControllerSchema {
namespace: "voice",
function: "server_start",
- description:
- "Start the voice dictation server (hotkey → record → transcribe → insert text).",
+ description: "Start the voice dictation server (hotkey → record → transcribe → insert text).",
inputs: vec![
optional_string("hotkey", "Hotkey combination (default: Fn)."),
optional_string(
@@ -365,8 +352,7 @@ pub fn voice_schemas(function: &str) -> ControllerSchema {
"overlay_stt_notify" => ControllerSchema {
namespace: "voice",
function: "overlay_stt_notify",
- description:
- "Notify the overlay of a voice/STT state change from the chat prompt button.",
+ description: "Notify the overlay of a voice/STT state change from the chat prompt button.",
inputs: vec![
required_string(
"state",
diff --git a/crates/openhuman-core/src/voice/schemas_tests.rs b/crates/openhuman-core/src/voice/schemas_tests.rs
index 0f93e1eb32..04baeb9607 100644
--- a/crates/openhuman-core/src/voice/schemas_tests.rs
+++ b/crates/openhuman-core/src/voice/schemas_tests.rs
@@ -75,19 +75,21 @@ fn status_schema_has_no_inputs() {
#[test]
fn transcribe_schema_requires_audio_path() {
let s = voice_schemas("voice_transcribe");
- assert!(s
- .inputs
- .iter()
- .any(|i| i.name == "audio_path" && i.required));
+ assert!(
+ s.inputs
+ .iter()
+ .any(|i| i.name == "audio_path" && i.required)
+ );
}
#[test]
fn transcribe_bytes_schema_requires_audio_bytes() {
let s = voice_schemas("voice_transcribe_bytes");
- assert!(s
- .inputs
- .iter()
- .any(|i| i.name == "audio_bytes" && i.required));
+ assert!(
+ s.inputs
+ .iter()
+ .any(|i| i.name == "audio_bytes" && i.required)
+ );
}
#[test]
@@ -141,7 +143,7 @@ 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};
+ use tokio::time::{Duration, timeout};
let mut rx = subscribe_dictation_events();
let params = Map::from_iter([("state".to_string(), json!("recording_started"))]);
@@ -431,10 +433,11 @@ fn update_provider_settings_schema_has_correct_inputs() {
#[test]
fn list_models_schema_requires_provider_id() {
let s = voice_schemas("voice_list_models");
- assert!(s
- .inputs
- .iter()
- .any(|i| i.name == "provider_id" && i.required));
+ assert!(
+ s.inputs
+ .iter()
+ .any(|i| i.name == "provider_id" && i.required)
+ );
}
#[test]
diff --git a/crates/openhuman-core/src/voice/server/hotkey_listener.rs b/crates/openhuman-core/src/voice/server/hotkey_listener.rs
index 4a4f69b6ba..049f4f26e6 100644
--- a/crates/openhuman-core/src/voice/server/hotkey_listener.rs
+++ b/crates/openhuman-core/src/voice/server/hotkey_listener.rs
@@ -473,7 +473,7 @@ async fn close_globe(
Err(crate::modules::accessibility::AccessibilityError::Operation(error))
if error.code == "UNKNOWN_LISTENER" =>
{
- return
+ return;
}
Err(error) => warn!("{LOG_PREFIX} Globe cleanup pending: {error}"),
}
diff --git a/crates/openhuman-core/src/voice/server/hotkey_listener_tests.rs b/crates/openhuman-core/src/voice/server/hotkey_listener_tests.rs
index 873c809b4e..07cd89deea 100644
--- a/crates/openhuman-core/src/voice/server/hotkey_listener_tests.rs
+++ b/crates/openhuman-core/src/voice/server/hotkey_listener_tests.rs
@@ -198,7 +198,7 @@ async fn listener_fixture() -> (
ListenerFixture,
tinybus::Connection,
) {
- use tinybus::{broker::Broker, transport::memory::MemoryBus, Connection, ObjectPath};
+ use tinybus::{Connection, ObjectPath, broker::Broker, transport::memory::MemoryBus};
let bus = MemoryBus::new();
Broker::new().spawn(bus.clone());
let service = Connection::connect(bus.connect().await.unwrap())
@@ -271,14 +271,16 @@ async fn lost_start_reply_recovers_the_lease_before_releasing_admission_fixture(
.lose_start_reply
.store(true, std::sync::atomic::Ordering::SeqCst);
fixture.allow_start.notify_one();
- assert!(start_globe_with_client(
- &crate::core::runtime::DispatchCtx::default(),
- client,
- Push,
- &CancellationToken::new()
- )
- .await
- .is_err());
+ assert!(
+ start_globe_with_client(
+ &crate::core::runtime::DispatchCtx::default(),
+ client,
+ Push,
+ &CancellationToken::new()
+ )
+ .await
+ .is_err()
+ );
tokio::time::timeout(
std::time::Duration::from_secs(5),
fixture.stopped.notified(),
diff --git a/crates/openhuman-core/src/voice/server/pipeline.rs b/crates/openhuman-core/src/voice/server/pipeline.rs
index 011b5e2505..ba18bc2140 100644
--- a/crates/openhuman-core/src/voice/server/pipeline.rs
+++ b/crates/openhuman-core/src/voice/server/pipeline.rs
@@ -3,8 +3,8 @@
//! (min duration, silence, hallucination) and the initial-prompt / recent
//! transcript bookkeeping that improves STT continuity.
-use std::sync::atomic::Ordering;
use std::sync::Arc;
+use std::sync::atomic::Ordering;
use std::time::Instant;
use log::{debug, info, warn};
@@ -13,13 +13,13 @@ use tokio::sync::Mutex;
use crate::config::Config;
use crate::modules::accessibility::{AccessibilityClient, FocusTarget, PasteRequest};
use crate::modules::voice::{
- gate_recording, is_hallucinated, GateVerdict, HallucinationMode, RecordingGates, SessionInput,
+ GateVerdict, HallucinationMode, RecordingGates, SessionInput, gate_recording, is_hallucinated,
};
use crate::voice::audio_capture::RecordingHandle;
-use super::recorder::Recorder;
-use super::types::{VoiceServerConfig, MAX_INITIAL_PROMPT_CHARS, MAX_RECENT_TRANSCRIPTS};
use super::LOG_PREFIX;
+use super::recorder::Recorder;
+use super::types::{MAX_INITIAL_PROMPT_CHARS, MAX_RECENT_TRANSCRIPTS, VoiceServerConfig};
/// Capture the frontmost app name at hotkey press so insertion can be validated later.
#[cfg(target_os = "macos")]
@@ -206,17 +206,22 @@ pub(super) async fn process_recording_bg(
// inserts into the user's active text field, so a stray
// "Thank you." is visible and undoable, while a filter that
// failed closed would swallow real dictation with no trace.
- let hallucinated =
- match is_hallucinated(config, text, HallucinationMode::Dictation).await {
- Ok(verdict) => verdict,
- Err(error) => {
- warn!(
+ let hallucinated = match is_hallucinated(
+ config,
+ text,
+ HallucinationMode::Dictation,
+ )
+ .await
+ {
+ Ok(verdict) => verdict,
+ Err(error) => {
+ warn!(
"{LOG_PREFIX} [pipeline={pipeline_id}] stage=gate_hallucination \
UNAVAILABLE ({error}); passing text through"
);
- false
- }
- };
+ false
+ }
+ };
if hallucinated {
warn!(
"{LOG_PREFIX} [pipeline={pipeline_id}] stage=gate_hallucination DROPPED text='{}'",
@@ -261,7 +266,9 @@ pub(super) async fn process_recording_bg(
})
.await
{
- warn!("{LOG_PREFIX} [pipeline={pipeline_id}] stage=deliver_paste FAILED: {e}");
+ warn!(
+ "{LOG_PREFIX} [pipeline={pipeline_id}] stage=deliver_paste FAILED: {e}"
+ );
*last_error.lock().await = Some(e.to_string());
} else {
let insert_elapsed = insert_started.elapsed();
@@ -274,7 +281,9 @@ pub(super) async fn process_recording_bg(
}
}
} else {
- warn!("{LOG_PREFIX} [pipeline={pipeline_id}] stage=gate_empty DROPPED (transcription was blank)");
+ warn!(
+ "{LOG_PREFIX} [pipeline={pipeline_id}] stage=gate_empty DROPPED (transcription was blank)"
+ );
}
}
Err(e) => {
@@ -282,7 +291,9 @@ pub(super) async fn process_recording_bg(
// subprocess layer and logged with a 5-minute backoff.
// Demote to warn! so they don't flood Sentry (issue #5168).
if e.contains("STATUS_DLL_NOT_FOUND") {
- warn!("{LOG_PREFIX} [pipeline={pipeline_id}] stage=transcribe DLL_UNAVAILABLE: {e}");
+ warn!(
+ "{LOG_PREFIX} [pipeline={pipeline_id}] stage=transcribe DLL_UNAVAILABLE: {e}"
+ );
} else {
warn!("{LOG_PREFIX} [pipeline={pipeline_id}] stage=transcribe FAILED: {e}");
}
diff --git a/crates/openhuman-core/src/voice/server/recorder.rs b/crates/openhuman-core/src/voice/server/recorder.rs
index 5efdfb1e9f..4c689960a1 100644
--- a/crates/openhuman-core/src/voice/server/recorder.rs
+++ b/crates/openhuman-core/src/voice/server/recorder.rs
@@ -14,8 +14,8 @@ use tokio::sync::Mutex;
use crate::config::Config;
use crate::modules::voice::{RecorderSession, SessionAdvance, SessionInput};
-use super::types::ServerState;
use super::LOG_PREFIX;
+use super::types::ServerState;
/// A recording session plus the phase mirror it keeps current.
#[derive(Clone)]
diff --git a/crates/openhuman-core/src/voice/server/runtime.rs b/crates/openhuman-core/src/voice/server/runtime.rs
index 3a5ae91898..ddb9de586a 100644
--- a/crates/openhuman-core/src/voice/server/runtime.rs
+++ b/crates/openhuman-core/src/voice/server/runtime.rs
@@ -4,8 +4,8 @@
//! means lives in the `tinyvoice` module; this loop reports facts to it
//! (`SessionAdvance`) and performs the action it answers with.
-use std::sync::atomic::Ordering;
use std::sync::Arc;
+use std::sync::atomic::Ordering;
use log::{debug, info, warn};
use tokio::sync::Mutex;
@@ -17,11 +17,11 @@ use crate::modules::voice::{RecorderSession, SessionAction, SessionInput};
use crate::voice::audio_capture::{self, RecordingHandle};
use tinyvoice_bus::hotkey::{ActivationMode, HotkeyEvent};
+use super::LOG_PREFIX;
use super::hotkey_listener::start_hotkey_listener;
use super::pipeline::{capture_expected_app_name, process_recording_bg};
use super::recorder::Recorder;
use super::types::{ServerState, VoiceServerConfig, VoiceServerStatus};
-use super::LOG_PREFIX;
type RecordingSetupReceiver =
tokio::sync::oneshot::Receiver<Result<(RecordingHandle, Option<String>), String>>;
diff --git a/crates/openhuman-core/src/voice/server/singleton.rs b/crates/openhuman-core/src/voice/server/singleton.rs
index 86f3261084..710f5e0520 100644
--- a/crates/openhuman-core/src/voice/server/singleton.rs
+++ b/crates/openhuman-core/src/voice/server/singleton.rs
@@ -8,9 +8,9 @@ use log::{info, warn};
use crate::config::Config;
use tinyvoice_bus::hotkey::ActivationMode;
+use super::LOG_PREFIX;
use super::runtime::VoiceServer;
use super::types::{ServerState, VoiceServerConfig};
-use super::LOG_PREFIX;
/// Global voice server instance, lazily initialized.
static VOICE_SERVER: once_cell::sync::OnceCell<Arc<VoiceServer>> = once_cell::sync::OnceCell::new();
diff --git a/crates/openhuman-core/src/voice/stub.rs b/crates/openhuman-core/src/voice/stub.rs
index f129dea2cc..3a7bc6d6da 100644
--- a/crates/openhuman-core/src/voice/stub.rs
+++ b/crates/openhuman-core/src/voice/stub.rs
@@ -73,21 +73,6 @@ pub fn create_stt_provider(
Err(anyhow::anyhow!(DISABLED_MSG))
}
-// ---------------------------------------------------------------------------
-// Event bus surface (mirrors `bus::publish_ptt_transcript_committed`)
-// ---------------------------------------------------------------------------
-
-/// No-op: with voice disabled there is no PTT dictation path to announce.
-pub fn publish_ptt_transcript_committed(
- _thread_id: String,
- _session_id: u64,
- _text_len: usize,
- _held_ms: u64,
- _finalized_by_watchdog: bool,
-) {
- log::debug!("[voice-stub] publish_ptt_transcript_committed ignored (voice disabled)");
-}
-
// ---------------------------------------------------------------------------
// cli::run_standalone_subcommand (kept registered as a CLI adapter)
// ---------------------------------------------------------------------------
diff --git a/crates/openhuman-core/src/web_chat/run_task.rs b/crates/openhuman-core/src/web_chat/run_task.rs
index 69ca2e8ad7..5fcf088a88 100644
--- a/crates/openhuman-core/src/web_chat/run_task.rs
+++ b/crates/openhuman-core/src/web_chat/run_task.rs
@@ -12,8 +12,8 @@ use crate::progress::AgentProgress;
use super::ops::BudgetCorrelation;
use super::progress_bridge::spawn_progress_bridge;
use super::session::{
- checkin_session_agent, checkout_session_agent, normalize_model_override, CheckedOutSession,
- CheckoutPolicy,
+ CheckedOutSession, CheckoutPolicy, checkin_session_agent, checkout_session_agent,
+ normalize_model_override,
};
use super::types::{ChatRequestMetadata, WebChatTaskResult};
use super::web_errors::{
@@ -322,17 +322,6 @@ pub(crate) async fn run_chat_task(
),
}
}
- if metadata.source.as_deref() == Some("ptt") {
- if let Some(session_id) = metadata.session_id {
- crate::voice::publish_ptt_transcript_committed(
- thread_id.to_string(),
- session_id,
- task_result.full_response.chars().count(),
- 0,
- false,
- );
- }
- }
}
// TinyMemes: remix the final reply (slang + memes) when the flag puts this