Skip to content

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

fix(channels): require hosted user session for channel delivery

Steven Enamakel8d505141ad44
diff --git a/crates/openhuman-core/src/channels/bus/delivery.rs b/crates/openhuman-core/src/channels/bus/delivery.rs
index cc78d7a6f7..ab6d7cfad5 100644
--- a/crates/openhuman-core/src/channels/bus/delivery.rs
+++ b/crates/openhuman-core/src/channels/bus/delivery.rs
@@ -198,8 +198,14 @@ pub(super) async fn build_channel_client() -> Option<(
}
};
let jwt =
- match crate::security::credentials::session_support::resolve_backend_credential(&config) {
- Ok(credential) => credential,
+ match crate::security::credentials::session_support::get_session_token(&config) {
+ Ok(Some(token)) if !crate::security::credentials::session_support::is_local_session_token(&token) => {
+ crate::security::credentials::session_support::BackendCredential::Session(token)
+ }
+ Ok(_) => {
+ tracing::error!("[channel-inbound] no hosted user session — cannot send");
+ return None;
+ }
Err(e) => {
tracing::error!(
"[channel-inbound] no backend credential — cannot send: {}",
@@ -228,8 +234,14 @@ pub(super) async fn send_channel_reply(channel: &str, text: &str) {
};
let jwt =
- match crate::security::credentials::session_support::resolve_backend_credential(&config) {
- Ok(credential) => credential,
+ match crate::security::credentials::session_support::get_session_token(&config) {
+ Ok(Some(token)) if !crate::security::credentials::session_support::is_local_session_token(&token) => {
+ crate::security::credentials::session_support::BackendCredential::Session(token)
+ }
+ Ok(_) => {
+ tracing::error!("[channel-inbound] no hosted user session — cannot send");
+ return;
+ }
Err(e) => {
tracing::error!(
"[channel-inbound] no backend credential — cannot reply: {}",
diff --git a/crates/openhuman-embed/README.md b/crates/openhuman-embed/README.md
index da77cde126..075407441d 100644
--- a/crates/openhuman-embed/README.md
+++ b/crates/openhuman-embed/README.md
@@ -146,10 +146,9 @@ TinyHumans OpenAI-compatible endpoint, backend REST calls send it as
its own `Provider` (BYOK) never touches the key.
The key covers every hosted feature the core reaches: managed inference, cloud
-embeddings, voice (STT, TTS, the realtime voice agent), web search, media
-generation, the Jev ranker, Composio and the other `/agent-integrations/*`
-tools, channel delivery, referral, and webhooks. The Socket.IO relay requires
-a signed-in user session. Callers that
+embeddings, voice (STT and TTS), web search, media generation, the Jev ranker,
+Composio and the other `/agent-integrations/*` tools, referral, and webhooks.
+The realtime voice agent and Socket.IO relay require a signed-in user session. Callers that
can only send a bearer (the vendored STT and embedding clients, the connector
module's proxy route, TinyCortex's Composio sync) send the key as
`Authorization: Bearer`, which the backend accepts because it recognises the