The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
chore: reformat long function signatures and match arms for readability
Steven Enamakel2a612c5c9eb1
diff --git a/crates/openhuman-core/src/api/rest.rs b/crates/openhuman-core/src/api/rest.rsindex 501d1ec97f..49d3b116be 100644--- a/crates/openhuman-core/src/api/rest.rs+++ b/crates/openhuman-core/src/api/rest.rs@@ -884,7 +884,10 @@ impl BackendOAuthClient {}/// Lists all active integrations for the current user.- pub async fn list_integrations(&self, credential: impl Into<BackendCredential>) -> Result<Vec<IntegrationSummary>> {+ pub async fn list_integrations(+ &self,+ credential: impl Into<BackendCredential>,+ ) -> Result<Vec<IntegrationSummary>> {let value = self.authed_json(credential, Method::GET, "auth/integrations", None).await?;@@ -982,7 +985,11 @@ impl BackendOAuthClient {/// so callers should re-invoke every ~4 s for as long as the turn is/// in flight. Returns `Err` if the backend doesn't support typing for/// this channel — caller should swallow the error silently.- pub async fn send_channel_typing(&self, channel: &str, credential: impl Into<BackendCredential>) -> Result<Value> {+ pub async fn send_channel_typing(+ &self,+ channel: &str,+ credential: impl Into<BackendCredential>,+ ) -> Result<Value> {let channel = channel.trim().trim_matches('/');anyhow::ensure!(!channel.is_empty(), "channel is required");let encoded = urlencoding::encode(channel);@@ -1146,7 +1153,11 @@ impl BackendOAuthClient {}/// Revokes (deletes) an active integration.- pub async fn revoke_integration(&self, integration_id: &str, credential: impl Into<BackendCredential>) -> Result<()> {+ pub async fn revoke_integration(+ &self,+ integration_id: &str,+ credential: impl Into<BackendCredential>,+ ) -> Result<()> {let id = integration_id.trim();anyhow::ensure!(!id.is_empty(), "integration id is required");self.authed_json(diff --git a/crates/openhuman-core/src/channels/bus/delivery.rs b/crates/openhuman-core/src/channels/bus/delivery.rsindex 14f2b67f5d..1de40c9655 100644--- a/crates/openhuman-core/src/channels/bus/delivery.rs+++ b/crates/openhuman-core/src/channels/bus/delivery.rs@@ -198,15 +198,17 @@ pub(super) async fn build_channel_client() -> Option<(}};let api_url = crate::api::config::effective_backend_api_url(&config.api_url);- let jwt = match crate::security::credentials::session_support::resolve_backend_credential(- &config,- ) {- Ok(credential) => credential,- Err(e) => {- tracing::error!("[channel-inbound] no backend credential — cannot send: {}", e);- return None;- }- };+ let jwt =+ match crate::security::credentials::session_support::resolve_backend_credential(&config) {+ Ok(credential) => credential,+ Err(e) => {+ tracing::error!(+ "[channel-inbound] no backend credential — cannot send: {}",+ e+ );+ return None;+ }+ };match crate::api::rest::BackendOAuthClient::new(&api_url) {Ok(c) => Some((c, jwt)),Err(e) => {@@ -227,15 +229,17 @@ pub(super) async fn send_channel_reply(channel: &str, text: &str) {};let api_url = crate::api::config::effective_backend_api_url(&config.api_url);- let jwt = match crate::security::credentials::session_support::resolve_backend_credential(- &config,- ) {- Ok(credential) => credential,- Err(e) => {- tracing::error!("[channel-inbound] no backend credential — cannot reply: {}", e);- return;- }- };+ let jwt =+ match crate::security::credentials::session_support::resolve_backend_credential(&config) {+ Ok(credential) => credential,+ Err(e) => {+ tracing::error!(+ "[channel-inbound] no backend credential — cannot reply: {}",+ e+ );+ return;+ }+ };let client = match crate::api::rest::BackendOAuthClient::new(&api_url) {Ok(c) => c,diff --git a/crates/openhuman-core/src/channels/controllers/ops/messaging.rs b/crates/openhuman-core/src/channels/controllers/ops/messaging.rsindex 68fc6a606e..e4c5289c65 100644--- a/crates/openhuman-core/src/channels/controllers/ops/messaging.rs+++ b/crates/openhuman-core/src/channels/controllers/ops/messaging.rs@@ -3,10 +3,10 @@use serde_json::Value;use crate::api::config::effective_backend_api_url;-use crate::security::credentials::session_support::resolve_backend_credential;use crate::api::rest::BackendOAuthClient;use crate::config::Config;use crate::rpc::RpcOutcome;+use crate::security::credentials::session_support::resolve_backend_credential;/// Send a rich message to a channel via the backend API.pub async fn channel_send_message(diff --git a/crates/openhuman-core/src/core/runtime/services.rs b/crates/openhuman-core/src/core/runtime/services.rsindex 25c78f9fa9..98d0651684 100644--- a/crates/openhuman-core/src/core/runtime/services.rs+++ b/crates/openhuman-core/src/core/runtime/services.rs@@ -439,19 +439,21 @@ pub fn spawn_socket_auto_connect(};let api_url = crate::api::config::effective_backend_api_url(&config.api_url);// The API key when one is stored, else the session token.- let initial_token = match crate::security::credentials::session_support::backend_bearer_secret(&config) {- Ok(Some(t)) => t,- Ok(None) => {- log::info!(+ let initial_token =+ match crate::security::credentials::session_support::backend_bearer_secret(&config)+ {+ Ok(Some(t)) => t,+ Ok(None) => {+ log::info!("[socket] No session token stored — skipping auto-connect (will connect after login)");- return;- }- Err(e) => {- log::warn!("[socket] Failed to read session token: {e}");- return;- }- };+ return;+ }+ Err(e) => {+ log::warn!("[socket] Failed to read session token: {e}");+ return;+ }+ };log::info!("[socket] Session token found — auto-connecting to {}",api_urldiff --git a/crates/openhuman-core/src/inference/embedding_host/cloud_adapter.rs b/crates/openhuman-core/src/inference/embedding_host/cloud_adapter.rsindex 9ebe6fe4ce..e1dd32fac8 100644--- a/crates/openhuman-core/src/inference/embedding_host/cloud_adapter.rs+++ b/crates/openhuman-core/src/inference/embedding_host/cloud_adapter.rs@@ -41,9 +41,7 @@ impl OpenHumanCloudEmbeddingModel {// non-loopback wire.if let Some(key) =crate::security::credentials::api_key::get_api_key_in(&state_dir, secrets_encrypt)- .map_err(|error| {- tinyinference_embeddings::Error::Embedding(error.to_string())- })?+ .map_err(|error| tinyinference_embeddings::Error::Embedding(error.to_string()))?{if !crate::inference::provider::openhuman_backend_model::is_safe_endpoint_for_managed_bearer(&key_endpoint,diff --git a/crates/openhuman-core/src/inference/embedding_host/cloud_adapter_tests.rs b/crates/openhuman-core/src/inference/embedding_host/cloud_adapter_tests.rsindex 06d2136d6e..d3683a4439 100644--- a/crates/openhuman-core/src/inference/embedding_host/cloud_adapter_tests.rs+++ b/crates/openhuman-core/src/inference/embedding_host/cloud_adapter_tests.rs@@ -164,7 +164,8 @@ async fn api_key_is_refused_over_plaintext_non_loopback() {);let err = provider.embed(&["hello".to_string()]).await.unwrap_err();assert!(- err.to_string().contains("refusing to send the TinyHumans API key"),+ err.to_string()+ .contains("refusing to send the TinyHumans API key"),"{err}");}diff --git a/crates/openhuman-core/src/integrations/client/pricing.rs b/crates/openhuman-core/src/integrations/client/pricing.rsindex fa881285eb..937b172dc7 100644--- a/crates/openhuman-core/src/integrations/client/pricing.rs+++ b/crates/openhuman-core/src/integrations/client/pricing.rs@@ -144,9 +144,7 @@ fn build_client_with_credential(None => return None,};if credential.secret().is_empty() {- tracing::warn!(- "[integrations] no auth token available — not signed in and no API key set"- );+ tracing::warn!("[integrations] no auth token available — not signed in and no API key set");return None;}tracing::debug!(diff --git a/crates/openhuman-core/src/modules/memory_host.rs b/crates/openhuman-core/src/modules/memory_host.rsindex c2466be65b..197d5e23c1 100644--- a/crates/openhuman-core/src/modules/memory_host.rs+++ b/crates/openhuman-core/src/modules/memory_host.rs@@ -302,11 +302,9 @@ impl ComposioCallbacks {async fn session_bearer(&self) -> tinybus::Result<Option<String>> {let config = self.live_config_or_installed().await;Ok(- crate::security::credentials::session_support::backend_bearer_secret(- config.as_ref(),- )- .ok()- .flatten(),+ crate::security::credentials::session_support::backend_bearer_secret(config.as_ref())+ .ok()+ .flatten(),)}diff --git a/crates/openhuman-core/src/voice/realtime.rs b/crates/openhuman-core/src/voice/realtime.rsindex e0d14414ba..c4b003d734 100644--- a/crates/openhuman-core/src/voice/realtime.rs+++ b/crates/openhuman-core/src/voice/realtime.rs@@ -91,7 +91,12 @@ pub async fn mint_voice_agent_signed_url(let client = BackendOAuthClient::new(&api_url).map_err(|e| e.to_string())?;let raw = client- .authed_json(&credential, Method::GET, "/voice-agent/get-signed-url", None)+ .authed_json(+ &credential,+ Method::GET,+ "/voice-agent/get-signed-url",+ None,+ ).await.map_err(crate::api::flatten_authed_error)?;