Skip to content

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

fix(hosted): require installed backend transport in from_config

Steven Enamakeld917c66a5ace
diff --git a/crates/openhuman-tinyhumans/src/hosted/client.rs b/crates/openhuman-tinyhumans/src/hosted/client.rs
index e1588b6733..b8d92caf44 100644
--- a/crates/openhuman-tinyhumans/src/hosted/client.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/client.rs
@@ -6,7 +6,8 @@
//! # Credential first, no network
//!
//! [`HostedClient::from_config`] asks the core for the credential
-//! ([`resolve_backend_credential`]) before anything touches the network. The
+//! ([`resolve_backend_credential`]) and requires an installed backend
+//! transport before anything touches the network. The
//! offline local session, a missing token and a locally-expired token all come
//! back as the core's own error string, which already carries the right
//! sentinel (`BACKEND_UNAVAILABLE:` / `SESSION_EXPIRED:`), so a user without a
@@ -60,9 +61,8 @@ pub struct HostedClient {
impl HostedClient {
/// Resolve the credential for `config` and build the client.
///
- /// Errors without any network I/O when there is no usable credential; the
- /// error is the core's own string, returned unchanged (it already carries
- /// its sentinel).
+ /// Errors without network I/O when there is no usable credential or
+ /// installed backend transport, with the appropriate core sentinel.
pub fn from_config(config: &Config) -> Result<Self, String> {
let credential = resolve_backend_credential(config).inspect_err(|err| {
log::debug!("{LOG_PREFIX} no usable backend credential; skipping request: {err}");
diff --git a/crates/openhuman-tinyhumans/src/hosted/client_tests.rs b/crates/openhuman-tinyhumans/src/hosted/client_tests.rs
index dcf4eb4160..c41256248b 100644
--- a/crates/openhuman-tinyhumans/src/hosted/client_tests.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/client_tests.rs
@@ -173,9 +173,6 @@ async fn session_client_sends_bearer_and_product_identity() {
.mount(&server)
.await;
- let tmp = TempDir::new().unwrap();
- let config = test_config(&tmp, &server.uri());
- store_session(&config, "jwt.a.b");
let client = HostedClient::with_credential(
&server.uri(),
BackendCredential::Session("jwt.a.b".into()),