Skip to content

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

chore: reformat long function calls and conditionals for readability

Steven Enamakeld3fc4099a1bd
diff --git a/crates/openhuman-core/src/backend/client.rs b/crates/openhuman-core/src/backend/client.rs
index cef6ff160c..05b23a6b19 100644
--- a/crates/openhuman-core/src/backend/client.rs
+++ b/crates/openhuman-core/src/backend/client.rs
@@ -418,10 +418,16 @@ impl BackendClient {
) -> Result<Value> {
let credential = credential.into();
let is_api_key = credential.is_api_key();
- if is_api_key && !crate::inference::provider::openhuman_backend_model::is_managed_endpoint_for_api_key(self.base.as_str()) {
+ if is_api_key
+ && !crate::inference::provider::openhuman_backend_model::is_managed_endpoint_for_api_key(
+ self.base.as_str(),
+ )
+ {
anyhow::bail!("TinyHumans API key requires the managed backend or a loopback endpoint");
}
- if !crate::inference::provider::openhuman_backend_model::is_safe_endpoint_for_managed_bearer(self.base.as_str()) {
+ if !crate::inference::provider::openhuman_backend_model::is_safe_endpoint_for_managed_bearer(
+ self.base.as_str(),
+ ) {
anyhow::bail!("backend credential requires HTTPS or a loopback HTTP endpoint");
}
let transport = self.transport(&method, path)?;
diff --git a/crates/openhuman-core/src/core/runtime/services.rs b/crates/openhuman-core/src/core/runtime/services.rs
index 5d7e493806..09a77bddcd 100644
--- a/crates/openhuman-core/src/core/runtime/services.rs
+++ b/crates/openhuman-core/src/core/runtime/services.rs
@@ -442,8 +442,7 @@ pub fn spawn_socket_auto_connect(
return;
};
let initial_token =
- match crate::security::credentials::session_support::get_session_token(&config)
- {
+ match crate::security::credentials::session_support::get_session_token(&config) {
Ok(Some(t)) => t,
Ok(None) => {
log::info!(
diff --git a/crates/openhuman-core/src/inference/provider/openhuman_backend_model.rs b/crates/openhuman-core/src/inference/provider/openhuman_backend_model.rs
index a11250a933..f292e5ee6a 100644
--- a/crates/openhuman-core/src/inference/provider/openhuman_backend_model.rs
+++ b/crates/openhuman-core/src/inference/provider/openhuman_backend_model.rs
@@ -78,8 +78,10 @@ pub(crate) fn is_managed_endpoint_for_api_key(endpoint: &str) -> bool {
if !is_safe_endpoint_for_managed_bearer(endpoint) {
return false;
}
- matches!(url.host_str(), Some("api.tinyhumans.ai" | "staging-api.tinyhumans.ai"))
- && url.scheme() == "https"
+ matches!(
+ url.host_str(),
+ Some("api.tinyhumans.ai" | "staging-api.tinyhumans.ai")
+ ) && url.scheme() == "https"
|| matches!(url.host_str(), Some("localhost" | "127.0.0.1" | "::1"))
}