Skip to content

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

feat(integrations): add credential-aware constructor for integration client

Steven Enamakelc70b16b0acc7
diff --git a/crates/openhuman-core/src/integrations/client/construct.rs b/crates/openhuman-core/src/integrations/client/construct.rs
index 598cbce530..4fbdbf5a4c 100644
--- a/crates/openhuman-core/src/integrations/client/construct.rs
+++ b/crates/openhuman-core/src/integrations/client/construct.rs
@@ -80,6 +80,19 @@ impl IntegrationClient {
}
pub fn new_with_budget_config(
+ backend_url: String,
+ auth_token: String,
+ config: Arc<crate::config::Config>,
+ ) -> Self {
+ Self::new_inner(
+ backend_url,
+ crate::security::credentials::session_support::BackendCredential::Session(auth_token),
+ Some(config),
+ )
+ }
+
+ /// Credential-aware variant of [`Self::new_with_budget_config`].
+ pub fn new_with_credential_and_budget_config(
backend_url: String,
credential: crate::security::credentials::session_support::BackendCredential,
config: Arc<crate::config::Config>,
diff --git a/crates/openhuman-core/src/integrations/client/pricing.rs b/crates/openhuman-core/src/integrations/client/pricing.rs
index f6f471feac..5df89b672f 100644
--- a/crates/openhuman-core/src/integrations/client/pricing.rs
+++ b/crates/openhuman-core/src/integrations/client/pricing.rs
@@ -160,7 +160,7 @@ fn build_client_with_credential(
api_key = credential.is_api_key(),
"[integrations] client built (backend credential resolved)"
);
- Some(Arc::new(IntegrationClient::new_with_budget_config(
+ Some(Arc::new(IntegrationClient::new_with_credential_and_budget_config(
backend_url,
credential,
Arc::new(config.clone()),