Skip to content

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

feat(composio): expose module transport config for connectors

Steven Enamakela52d5067b64f
diff --git a/crates/openhuman-core/src/integrations/composio/client.rs b/crates/openhuman-core/src/integrations/composio/client.rs
index 31406bffcb..430b037b0c 100644
--- a/crates/openhuman-core/src/integrations/composio/client.rs
+++ b/crates/openhuman-core/src/integrations/composio/client.rs
@@ -20,6 +20,7 @@ mod network;
mod tests;
pub use credential::DirectCredential;
+pub(crate) use network::module_transport;
pub use direct::direct_list_connections;
pub(crate) use direct::direct_list_tools;
pub(crate) use factory::create_direct_client_for_api_key;
diff --git a/crates/openhuman-core/src/integrations/composio/client/network.rs b/crates/openhuman-core/src/integrations/composio/client/network.rs
index f3fe15394f..0323f49823 100644
--- a/crates/openhuman-core/src/integrations/composio/client/network.rs
+++ b/crates/openhuman-core/src/integrations/composio/client/network.rs
@@ -37,7 +37,7 @@ fn usable(url: Option<&String>) -> Option<String> {
/// The network policy for a request to `base_url`, or `None` when it is the
/// module's default (no proxy of the host's choosing, bundled roots).
-pub(super) fn module_transport(base_url: &str) -> Option<ComposioTransportConfig> {
+pub(crate) fn module_transport(base_url: &str) -> Option<ComposioTransportConfig> {
let proxy = runtime_proxy_config();
let proxy_url = if proxy.should_apply_to_service(SERVICE_KEY) {
let https = base_url.trim().to_ascii_lowercase().starts_with("https://");
diff --git a/crates/openhuman-core/src/modules/connectors.rs b/crates/openhuman-core/src/modules/connectors.rs
index 392cff44ec..8d28cb6651 100644
--- a/crates/openhuman-core/src/modules/connectors.rs
+++ b/crates/openhuman-core/src/modules/connectors.rs
@@ -131,8 +131,20 @@ pub fn module_config(config: &Config) -> Result<serde_json::Value, String> {
"base_url": std::env::var("OPENHUMAN_COMPOSIO_DIRECT_BASE_V3").ok(),
"state_dir": state_dir,
});
- if let Some(base) = direct_base {
- payload["base_url"] = serde_json::Value::String(base);
+ if let Some(base) = &direct_base {
+ payload["base_url"] = serde_json::Value::String(base.clone());
+ }
+ // The host's proxy and TLS policy for Composio, resolved for the
+ // destination the module will dial. Part of the route description,
+ // so a change in the proxy settings reconfigures the module on the
+ // next call. Omitted when it is the module's default (contract 1.10).
+ let destination = direct_base
+ .as_deref()
+ .unwrap_or("https://backend.composio.dev/api/v3");
+ if let Some(transport) =
+ crate::integrations::composio::client::module_transport(destination)
+ {
+ payload["transport"] = serde_json::json!(transport);
}
Ok(payload)
}