Skip to content

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

fix(inference): skip session check for direct chat providers

Steven Enamakela4d9010c5d87
diff --git a/crates/openhuman-core/src/inference/provider/factory/access_gates.rs b/crates/openhuman-core/src/inference/provider/factory/access_gates.rs
index 39b2a8c0ce..f35d038ffb 100644
--- a/crates/openhuman-core/src/inference/provider/factory/access_gates.rs
+++ b/crates/openhuman-core/src/inference/provider/factory/access_gates.rs
@@ -162,6 +162,15 @@ pub(crate) fn verify_session_active(config: &Config) -> anyhow::Result<()> {
if !current_host_requires_session() {
return Ok(());
}
+ // A hosted profile on the operator's direct chat provider talks to that
+ // provider with the operator's key; it has no TinyHumans account.
+ if config
+ .profile_providers
+ .as_ref()
+ .is_some_and(|providers| providers.has_direct_chat())
+ {
+ return Ok(());
+ }
verify_backend_session_active(config)
}
diff --git a/crates/openhuman-core/src/profiles/provider_settings.rs b/crates/openhuman-core/src/profiles/provider_settings.rs
index 94b5bbb003..67168a28dc 100644
--- a/crates/openhuman-core/src/profiles/provider_settings.rs
+++ b/crates/openhuman-core/src/profiles/provider_settings.rs
@@ -44,6 +44,12 @@ impl ProfileProviderSettings {
.then_some(std::borrow::Cow::Borrowed(name))
}
+ /// Whether the operator configured a direct chat provider, so profile
+ /// turns need no TinyHumans backend credential.
+ pub(crate) fn has_direct_chat(&self) -> bool {
+ self.chat.is_some()
+ }
+
/// Validate operator-owned direct routes and their presentation.
///
/// # Errors