Skip to content

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

refactor(voice): extract type aliases and use case-insensitive provider check

Steven Enamakel192204827c24
diff --git a/crates/openhuman-core/src/hosting/mod.rs b/crates/openhuman-core/src/hosting/mod.rs
index 5c00dc9645..858e36875b 100644
--- a/crates/openhuman-core/src/hosting/mod.rs
+++ b/crates/openhuman-core/src/hosting/mod.rs
@@ -112,7 +112,7 @@ impl Account {
team: Option<&str>,
config: Config,
) -> anyhow::Result<Self> {
- if provider.trim().to_ascii_lowercase() != "vercel" {
+ if !provider.trim().eq_ignore_ascii_case("vercel") {
anyhow::bail!("unknown hosting provider `{provider}`");
}
if api_key.trim().is_empty() {
diff --git a/crates/openhuman-core/src/voice/dictation_listener.rs b/crates/openhuman-core/src/voice/dictation_listener.rs
index 04ca290eb5..463133f5be 100644
--- a/crates/openhuman-core/src/voice/dictation_listener.rs
+++ b/crates/openhuman-core/src/voice/dictation_listener.rs
@@ -23,8 +23,9 @@ const LOG_PREFIX: &str = "[dictation_listener]";
// ── Listener task handle (for stop support) ─────────────────────────
-static LISTENER_HANDLE: Lazy<Mutex<Option<(CancellationToken, JoinHandle<()>)>>> =
- Lazy::new(|| Mutex::new(None));
+type ListenerTask = (CancellationToken, JoinHandle<()>);
+
+static LISTENER_HANDLE: Lazy<Mutex<Option<ListenerTask>>> = Lazy::new(|| Mutex::new(None));
// ── Broadcast channel for dictation events ────────────────────────────
diff --git a/crates/openhuman-core/src/voice/server/runtime.rs b/crates/openhuman-core/src/voice/server/runtime.rs
index c3583d418d..9d2656a213 100644
--- a/crates/openhuman-core/src/voice/server/runtime.rs
+++ b/crates/openhuman-core/src/voice/server/runtime.rs
@@ -20,6 +20,9 @@ use super::pipeline::{capture_expected_app_name, process_recording_bg};
use super::types::{ServerState, VoiceServerConfig, VoiceServerStatus};
use super::LOG_PREFIX;
+type RecordingSetupReceiver =
+ tokio::sync::oneshot::Receiver<Result<(RecordingHandle, Option<String>), String>>;
+
/// The voice server runtime.
pub struct VoiceServer {
state: Arc<Mutex<ServerState>>,
@@ -116,9 +119,7 @@ impl VoiceServer {
// Pending recording setup: `start_recording()` runs on a blocking
// thread so the event loop stays responsive to Release events that
// macOS fires almost immediately for the Fn key.
- let mut recording_pending_rx: Option<
- tokio::sync::oneshot::Receiver<Result<(RecordingHandle, Option<String>), String>>,
- > = None;
+ let mut recording_pending_rx: Option<RecordingSetupReceiver> = None;
let mut pending_generation: Option<u64> = None;
let mut recording_generation: Option<u64> = None;
// Set when a stop-intent event (Release/Pressed toggle) arrives before