Skip to content

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

fix(embed): gate relay exports behind the channels feature

Steven Enamakela933e17cb452
diff --git a/crates/openhuman-embed/src/lib.rs b/crates/openhuman-embed/src/lib.rs
index a6202a7270..13836285ba 100644
--- a/crates/openhuman-embed/src/lib.rs
+++ b/crates/openhuman-embed/src/lib.rs
@@ -191,9 +191,10 @@ pub use harness::{HttpHeader, McpAuthConfig, McpServer};
pub use profiles::{
ChatReply, CronDelivery, CronReply, CronSweepReport, DirectProfileProvider, JobOrigin,
OpenError, ProfileError, ProfileEvents, ProfileHandle, ProfileId, ProfileIdMode,
- ProfileRuntime, ProfileRuntimeBuilder, ProfileSummary, Provisioned, RelayAccepted,
- RelayMessage, SaasConfig,
+ ProfileRuntime, ProfileRuntimeBuilder, ProfileSummary, Provisioned, SaasConfig,
};
+#[cfg(all(feature = "profiles", feature = "channels"))]
+pub use profiles::{RelayAccepted, RelayMessage};
pub use runtime::builder::DEFAULT_MAX_AGENTS;
/// Read-only view of a [`RuntimeBuilder`], for the layered crates' tests.
#[doc(hidden)]
diff --git a/crates/openhuman-embed/src/profiles.rs b/crates/openhuman-embed/src/profiles.rs
index 47bc3f5dd8..b0c3485ed7 100644
--- a/crates/openhuman-embed/src/profiles.rs
+++ b/crates/openhuman-embed/src/profiles.rs
@@ -63,7 +63,10 @@ use crate::error::CoreError;
mod handle;
mod host;
-pub use handle::{ChatReply, ProfileEvents, ProfileHandle, RelayAccepted};
+#[cfg(feature = "channels")]
+pub use handle::RelayAccepted;
+pub use handle::{ChatReply, ProfileEvents, ProfileHandle};
+#[cfg(feature = "channels")]
pub use openhuman_core::channels::providers::relay::RelayInboundParams as RelayMessage;
/// Validated operator-owned direct inference settings.
pub use openhuman_core::core::runtime::direct_profile_provider::DirectProfileProvider;
diff --git a/crates/openhuman-embed/src/profiles/handle.rs b/crates/openhuman-embed/src/profiles/handle.rs
index 95cb536902..3e57767e32 100644
--- a/crates/openhuman-embed/src/profiles/handle.rs
+++ b/crates/openhuman-embed/src/profiles/handle.rs
@@ -15,9 +15,11 @@ use serde::de::DeserializeOwned;
use serde::{Deserialize, Serialize};
use tokio::sync::broadcast;
+#[cfg(feature = "channels")]
+use super::RelayMessage;
use super::{
ConversationMessageRecord, ConversationThreadSummary, Inner, ProfileError, ProfileId,
- RelayMessage, WebChannelEvent,
+ WebChannelEvent,
};
use crate::call::call_in;
use crate::error::CoreError;
@@ -27,6 +29,7 @@ const THREADS_MESSAGE_APPEND: &str = "openhuman.threads_message_append";
const THREADS_LIST: &str = "openhuman.threads_list";
const THREADS_MESSAGES_LIST: &str = "openhuman.threads_messages_list";
const CHANNEL_WEB_CHAT: &str = "openhuman.channel_web_chat";
+#[cfg(feature = "channels")]
const CHANNEL_RELAY_INBOUND: &str = "openhuman.channel_relay_inbound";
/// An open profile. Every call runs under the profile's own context, as a
@@ -63,6 +66,7 @@ pub struct ChatReply {
/// What `channel_relay_inbound` answered: the message was accepted (its turn
/// runs in the background) or was a duplicate of one already recorded.
+#[cfg(feature = "channels")]
#[derive(Debug, Clone, PartialEq, Eq, Deserialize)]
pub struct RelayAccepted {
/// Whether a turn was started for it.
@@ -265,6 +269,7 @@ impl ProfileHandle {
/// background; the reply arrives on [`events`](Self::events) as a
/// `channel_outbound` event for the host to deliver. A message id already
/// recorded is acknowledged as a duplicate and runs nothing.
+ #[cfg(feature = "channels")]
pub async fn relay_inbound(
&self,
message: RelayMessage,