Skip to content

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

feat(runtime): add configurable backend transport to RuntimeBuilder

Steven Enamakel1481ca0e6e49
diff --git a/crates/openhuman-embed/src/runtime/builder.rs b/crates/openhuman-embed/src/runtime/builder.rs
index 478abe606e..6635949c35 100644
--- a/crates/openhuman-embed/src/runtime/builder.rs
+++ b/crates/openhuman-embed/src/runtime/builder.rs
@@ -30,6 +30,7 @@ pub struct RuntimeBuilder {
session: Option<Session>,
backend_url: Option<String>,
api_key: Option<ApiKey>,
+ backend_transport: Option<Arc<dyn BackendTransport>>,
}
impl Default for RuntimeBuilder {
@@ -55,9 +56,24 @@ impl RuntimeBuilder {
session: None,
backend_url: None,
api_key: None,
+ backend_transport: None,
}
}
+ /// The transport the runtime reaches the hosted TinyHumans backend
+ /// through (see [`BackendTransport`]).
+ ///
+ /// The core carries no backend client of its own: without a transport
+ /// every hosted-backend surface (billing, integrations tools, channel
+ /// relay, cloud voice) answers with a typed "backend unavailable" error
+ /// while agents, memory, skills and RPC work as normal. The
+ /// `openhuman-tinyhumans` crate supplies the SDK-backed implementation
+ /// and a builder that installs it for you.
+ pub fn backend_transport(mut self, transport: Arc<dyn BackendTransport>) -> Self {
+ self.backend_transport = Some(transport);
+ self
+ }
+
/// Where the runtime keeps its credential store, session database and
/// every agent's memory, transcripts and skills.
pub fn workspace(mut self, workspace: Workspace) -> Self {
@@ -260,12 +276,16 @@ impl RuntimeBuilder {
self.provider.is_routed(),
);
- let runtime = CoreBuilder::new(host_kind)
+ let mut builder = CoreBuilder::new(host_kind)
.domains(domains)
.tool_groups(tool_groups.clone())
.services(services)
.token(TokenSource::EnvOrFile)
- .config(config.clone())
+ .config(config.clone());
+ if let Some(transport) = self.backend_transport {
+ builder = builder.backend_transport(transport);
+ }
+ let runtime = builder
.build()
.await
.map_err(RuntimeError::Build)?;