Skip to content

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

fix(channels): route delivery through the messaging channel

Steven Enamakel715ec57a648e
diff --git a/crates/openhuman-tinyhumans/src/channels/delivery.rs b/crates/openhuman-tinyhumans/src/channels/delivery.rs
index 027d22c704..47266f13c8 100644
--- a/crates/openhuman-tinyhumans/src/channels/delivery.rs
+++ b/crates/openhuman-tinyhumans/src/channels/delivery.rs
@@ -4,8 +4,6 @@
//! Transport refusals are typed facts mapped by [`map_backend_error`];
//! recovery and retry budgets belong to the channel module.
-#![cfg(feature = "channels")]
-
use openhuman_embed::__host::channel_callback::ChannelCallbackCtx;
use openhuman_embed::__host::security::credentials::session_support::{
get_session_token, is_local_session_token, BackendCredential,
diff --git a/crates/openhuman-tinyhumans/src/channels/messaging.rs b/crates/openhuman-tinyhumans/src/channels/messaging.rs
index a9bc1e9e1f..b018355b5f 100644
--- a/crates/openhuman-tinyhumans/src/channels/messaging.rs
+++ b/crates/openhuman-tinyhumans/src/channels/messaging.rs
@@ -4,15 +4,13 @@
//! in `raw` (and is parsed into the typed fields when its shape matches), so
//! the RPC response shapes are unchanged.
-#![cfg(feature = "channels")]
-
use openhuman_embed::__host::config::Config;
use openhuman_embed::__host::security::credentials::session_support::{
resolve_backend_credential, BackendCredential,
};
use serde_json::Value;
use tinychannels_bus::controllers::{
- ChannelReactionResult, ChannelSendMessageResult, ChannelThreadListResult, ChannelThreadResult,
+ ChannelReactionResult, ChannelThreadListResult, ChannelThreadResult,
};
use crate::client::{flatten_authed_error, BackendClient};
@@ -44,7 +42,6 @@ macro_rules! raw_fallback {
};
}
-raw_fallback!(ChannelSendMessageResult,);
raw_fallback!(ChannelReactionResult, success: true,);
raw_fallback!(ChannelThreadResult,);
raw_fallback!(ChannelThreadListResult,);
diff --git a/crates/openhuman-tinyhumans/src/channels/mod.rs b/crates/openhuman-tinyhumans/src/channels/mod.rs
index 9c1167fc1f..ae3808f572 100644
--- a/crates/openhuman-tinyhumans/src/channels/mod.rs
+++ b/crates/openhuman-tinyhumans/src/channels/mod.rs
@@ -12,7 +12,9 @@
//! The core keeps only the generic slot dispatch; with this callback
//! unregistered, those calls answer the `BACKEND_UNAVAILABLE:` sentinel.
+#[cfg(feature = "channels")]
mod delivery;
+#[cfg(feature = "channels")]
mod messaging;
#[cfg(feature = "channels")]
diff --git a/crates/openhuman-tinyhumans/src/voice/live_tests.rs b/crates/openhuman-tinyhumans/src/voice/live_tests.rs
index 7355b01570..9ea382187a 100644
--- a/crates/openhuman-tinyhumans/src/voice/live_tests.rs
+++ b/crates/openhuman-tinyhumans/src/voice/live_tests.rs
@@ -50,20 +50,19 @@ fn elevenlabs_hosted_config_owns_its_prompt_and_ignores_blank_voices() {
}
#[test]
-fn registration_lists_both_hosted_providers_as_hosted() {
+fn registration_installs_both_hosted_providers() {
register();
- let config = Config::default();
- let infos = openhuman_embed::__host::voice_registry::provider_infos(&config);
- for id in [LIVE_PROVIDER_GEMINI_HOSTED, LIVE_PROVIDER_ELEVENLABS_HOSTED] {
- let info = infos.iter().find(|i| i.id == id).expect(id);
- assert_eq!(info.kind, LiveProviderKind::Hosted, "{id}");
- assert_eq!(info.key_slug, None, "{id}");
- }
- let gemini = infos
- .iter()
- .find(|i| i.id == LIVE_PROVIDER_GEMINI_HOSTED)
- .unwrap();
- assert!(gemini.voices.contains(&"Puck".to_string()));
- unregister_live_provider(LIVE_PROVIDER_GEMINI_HOSTED);
- unregister_live_provider(LIVE_PROVIDER_ELEVENLABS_HOSTED);
+ assert!(unregister_live_provider(LIVE_PROVIDER_GEMINI_HOSTED));
+ assert!(unregister_live_provider(LIVE_PROVIDER_ELEVENLABS_HOSTED));
+}
+
+#[tokio::test]
+async fn hosted_providers_report_not_configured_without_a_backend_credential() {
+ let dir = tempfile::tempdir().unwrap();
+ let mut config = Config::default();
+ config.workspace_dir = dir.path().to_path_buf();
+ config.config_path = dir.path().join("config.toml");
+ assert!(!backend_ready(&config));
+ let err = prepare_gemini(config, LiveConfig::new()).await.err().unwrap();
+ assert_eq!(err.code, "not_configured");
}
diff --git a/crates/openhuman-tinyhumans/src/voice/mod.rs b/crates/openhuman-tinyhumans/src/voice/mod.rs
index 9d089550b8..acae8da688 100644
--- a/crates/openhuman-tinyhumans/src/voice/mod.rs
+++ b/crates/openhuman-tinyhumans/src/voice/mod.rs
@@ -1,14 +1,30 @@
//! Hosted speech: cloud transcription, reply speech, realtime voice agents and the hosted live providers.
//!
-//! Empty for now: the code for this area moves here from `openhuman-core`'s
-//! `backend/` and its consumers, and plugs back into the core through the
-//! generic registries on `openhuman_embed::__host` (`voice_registry`). [`register`] is the
-//! one place it does so; `crate::register::register_all` calls it from
-//! `install()`.
+//! Everything here plugs into the core through the generic registries on
+//! `openhuman_embed::__host::voice_registry`; the core holds no hosted voice
+//! route. [`register`] is the one place it does so; `crate::register::register_all`
+//! calls it from `install()`.
+//!
+//! - [`cloud_transcribe`]: `/openai/v1/audio/transcriptions` (STT).
+//! - [`reply_speech`]: `/openai/v1/audio/speech` (TTS with visemes).
+//! - [`realtime`]: `/voice-agent/get-signed-url` (ElevenLabs agent sessions) and
+//! the `voice.agent_signed_url` controller.
+//! - [`speech_providers`]: the STT/TTS providers registered under the
+//! `cloud` / `openhuman` / `backend` slugs.
+//! - [`live`]: the `gemini-hosted` and `elevenlabs-hosted` live providers.
+
+pub mod cloud_transcribe;
+pub mod live;
+pub mod realtime;
+pub mod reply_speech;
+pub mod speech_providers;
use crate::install::InstallOptions;
/// Registers this area's hooks with the core. Idempotent.
pub(crate) fn register(_options: &InstallOptions) {
- log::trace!("[tinyhumans] voice: nothing to register yet");
+ log::debug!("[tinyhumans] voice: registering hosted STT/TTS and live providers");
+ speech_providers::register();
+ live::register();
+ realtime::register();
}