Skip to content

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

refactor: reformat match arms and client construction for consistency

Steven Enamakel0097150feef7
diff --git a/crates/openhuman-core/src/channels/bus/delivery.rs b/crates/openhuman-core/src/channels/bus/delivery.rs
index ab6d7cfad5..a749ea7da6 100644
--- a/crates/openhuman-core/src/channels/bus/delivery.rs
+++ b/crates/openhuman-core/src/channels/bus/delivery.rs
@@ -197,23 +197,24 @@ pub(super) async fn build_channel_client() -> Option<(
return None;
}
};
- let jwt =
- match crate::security::credentials::session_support::get_session_token(&config) {
- Ok(Some(token)) if !crate::security::credentials::session_support::is_local_session_token(&token) => {
- crate::security::credentials::session_support::BackendCredential::Session(token)
- }
- Ok(_) => {
- tracing::error!("[channel-inbound] no hosted user session — cannot send");
- return None;
- }
- Err(e) => {
- tracing::error!(
- "[channel-inbound] no backend credential — cannot send: {}",
- e
- );
- return None;
- }
- };
+ let jwt = match crate::security::credentials::session_support::get_session_token(&config) {
+ Ok(Some(token))
+ if !crate::security::credentials::session_support::is_local_session_token(&token) =>
+ {
+ crate::security::credentials::session_support::BackendCredential::Session(token)
+ }
+ Ok(_) => {
+ tracing::error!("[channel-inbound] no hosted user session — cannot send");
+ return None;
+ }
+ Err(e) => {
+ tracing::error!(
+ "[channel-inbound] no backend credential — cannot send: {}",
+ e
+ );
+ return None;
+ }
+ };
match crate::backend::BackendClient::from_config(&config) {
Ok(c) => Some((c, jwt)),
Err(e) => {
@@ -233,23 +234,24 @@ pub(super) async fn send_channel_reply(channel: &str, text: &str) {
}
};
- let jwt =
- match crate::security::credentials::session_support::get_session_token(&config) {
- Ok(Some(token)) if !crate::security::credentials::session_support::is_local_session_token(&token) => {
- crate::security::credentials::session_support::BackendCredential::Session(token)
- }
- Ok(_) => {
- tracing::error!("[channel-inbound] no hosted user session — cannot send");
- return;
- }
- Err(e) => {
- tracing::error!(
- "[channel-inbound] no backend credential — cannot reply: {}",
- e
- );
- return;
- }
- };
+ let jwt = match crate::security::credentials::session_support::get_session_token(&config) {
+ Ok(Some(token))
+ if !crate::security::credentials::session_support::is_local_session_token(&token) =>
+ {
+ crate::security::credentials::session_support::BackendCredential::Session(token)
+ }
+ Ok(_) => {
+ tracing::error!("[channel-inbound] no hosted user session — cannot send");
+ return;
+ }
+ Err(e) => {
+ tracing::error!(
+ "[channel-inbound] no backend credential — cannot reply: {}",
+ e
+ );
+ return;
+ }
+ };
let client = match crate::backend::BackendClient::from_config(&config) {
Ok(c) => c,
diff --git a/crates/openhuman-core/src/integrations/client/pricing.rs b/crates/openhuman-core/src/integrations/client/pricing.rs
index 5df89b672f..fcca147461 100644
--- a/crates/openhuman-core/src/integrations/client/pricing.rs
+++ b/crates/openhuman-core/src/integrations/client/pricing.rs
@@ -160,11 +160,13 @@ fn build_client_with_credential(
api_key = credential.is_api_key(),
"[integrations] client built (backend credential resolved)"
);
- Some(Arc::new(IntegrationClient::new_with_credential_and_budget_config(
- backend_url,
- credential,
- Arc::new(config.clone()),
- )))
+ Some(Arc::new(
+ IntegrationClient::new_with_credential_and_budget_config(
+ backend_url,
+ credential,
+ Arc::new(config.clone()),
+ ),
+ ))
}
#[cfg(test)]