Skip to content

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

feat(tinyhumans): add backend header handling and client integration

Steven Enamakel1a8c5db69cdd
diff --git a/crates/openhuman-tinyhumans/src/backend/headers.rs b/crates/openhuman-tinyhumans/src/backend/headers.rs
index 9d4f345ee7..1ccbea894e 100644
--- a/crates/openhuman-tinyhumans/src/backend/headers.rs
+++ b/crates/openhuman-tinyhumans/src/backend/headers.rs
@@ -13,7 +13,7 @@ use anyhow::{Context, Result};
use reqwest::header::{HeaderMap, HeaderName, HeaderValue};
use std::time::Duration;
-use openhuman_embed::TransportProfile;
+use crate::transport::TransportProfile;
/// Upper bound on the `x-core-version` / `x-tauri-version` header values. A
/// version string is short; anything longer is a misconfigured environment and
diff --git a/crates/openhuman-tinyhumans/src/client/backend_channel_tests.rs b/crates/openhuman-tinyhumans/src/client/backend_channel_tests.rs
index 9edab0b3ad..e97db38a58 100644
--- a/crates/openhuman-tinyhumans/src/client/backend_channel_tests.rs
+++ b/crates/openhuman-tinyhumans/src/client/backend_channel_tests.rs
@@ -309,10 +309,10 @@ async fn sdk_backed_channel_typing_surfaces_unauthorized_on_401() {
// The transport owns what a channel-message 404 means on the backend; these
// pin the recovery the client attaches to each variant.
-use openhuman_embed::__host::backend::transport::{
+use crate::transport::{
BackendTransport, BackendTransportError, TransportProfile,
};
-use openhuman_embed::{BackendRequest, BaseUrlPurpose};
+use crate::transport::{BackendRequest, BaseUrlPurpose};
/// A transport that answers every request with the error `make` builds.
struct FailingTransport(fn() -> BackendTransportError);
diff --git a/crates/openhuman-tinyhumans/src/client/backend_client.rs b/crates/openhuman-tinyhumans/src/client/backend_client.rs
index 6a2b4ab34c..63513e6d8b 100644
--- a/crates/openhuman-tinyhumans/src/client/backend_client.rs
+++ b/crates/openhuman-tinyhumans/src/client/backend_client.rs
@@ -4,10 +4,10 @@
use std::sync::{Arc, Mutex};
use anyhow::{Context, Result};
-use openhuman_embed::__host::backend::transport::{BackendTransport, TransportProfile};
+use crate::transport::{BackendTransport, TransportProfile};
use openhuman_embed::__host::config::Config;
use openhuman_embed::__host::security::credentials::session_support::BackendCredential;
-use openhuman_embed::BackendRequest;
+use crate::transport::BackendRequest;
use reqwest::{Client, Method, Url};
use serde_json::Value;
diff --git a/crates/openhuman-tinyhumans/src/client/classify.rs b/crates/openhuman-tinyhumans/src/client/classify.rs
index 70b5841c1f..3b4647a818 100644
--- a/crates/openhuman-tinyhumans/src/client/classify.rs
+++ b/crates/openhuman-tinyhumans/src/client/classify.rs
@@ -3,7 +3,7 @@
//! which are reported.
use anyhow::{Context, Result};
-use openhuman_embed::__host::backend::transport::BackendTransportError;
+use crate::transport::BackendTransportError;
use openhuman_embed::__host::core::observability::{
contains_transient_transport_phrase, is_transient_http_status_code, report_error,
};
diff --git a/crates/openhuman-tinyhumans/src/client/integrations_http.rs b/crates/openhuman-tinyhumans/src/client/integrations_http.rs
index 63d403ae1f..03c5154835 100644
--- a/crates/openhuman-tinyhumans/src/client/integrations_http.rs
+++ b/crates/openhuman-tinyhumans/src/client/integrations_http.rs
@@ -13,14 +13,14 @@ use std::sync::{Arc, OnceLock};
use std::time::Duration;
use anyhow::Result;
-use openhuman_embed::__host::backend::transport::{
+use crate::transport::{
BackendTransport, BackendTransportError, TransportProfile,
};
use openhuman_embed::__host::security::credentials::session_support::BackendCredential;
use openhuman_embed::__host::util::redact_url_for_log;
use openhuman_embed::__host::util::tls::tls_client_builder;
use openhuman_embed::__host::util::url::{join_url, normalize_backend_api_base_url};
-use openhuman_embed::BackendRequest;
+use crate::transport::BackendRequest;
use reqwest::header::{HeaderMap, HeaderValue, AUTHORIZATION};
use reqwest::Method;
use serde_json::Value;
diff --git a/crates/openhuman-tinyhumans/src/hosted/client.rs b/crates/openhuman-tinyhumans/src/hosted/client.rs
index e1257b167a..20007fbffe 100644
--- a/crates/openhuman-tinyhumans/src/hosted/client.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/client.rs
@@ -30,7 +30,7 @@
//! phrases, budget exhaustion) keep matching them.
use crate::backend::url::effective_backend_api_url;
-use openhuman_embed::__host::backend::transport::{
+use crate::transport::{
resolve_backend_transport, BackendTransport, BackendTransportError, TransportProfile,
};
use openhuman_embed::__host::config::Config;
diff --git a/crates/openhuman-tinyhumans/src/transport/transport_tests.rs b/crates/openhuman-tinyhumans/src/transport/transport_tests.rs
index b77579b118..a3cc0321fa 100644
--- a/crates/openhuman-tinyhumans/src/transport/transport_tests.rs
+++ b/crates/openhuman-tinyhumans/src/transport/transport_tests.rs
@@ -2,7 +2,7 @@
//! code relies on, pinned against a mock backend.
use super::*;
-use openhuman_embed::__host::backend::transport::{
+use crate::transport::{
clear_backend_transport, resolve_backend_transport,
};
use serde_json::json;