Skip to content

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

feat(composio): move connector module client into composio integration

Steven Enamakel3f388b49e7ce
diff --git a/src/openhuman/integrations/composio/mod.rs b/src/openhuman/integrations/composio/mod.rs
index f923a7e918..9304e701e1 100644
--- a/src/openhuman/integrations/composio/mod.rs
+++ b/src/openhuman/integrations/composio/mod.rs
@@ -48,6 +48,7 @@ pub mod execute_dispatch;
pub mod execute_prepare;
pub mod googlecalendar_args;
pub mod identity;
+pub mod module_client;
pub mod oauth_handoff;
pub mod ops;
pub mod periodic;
diff --git a/src/openhuman/integrations/composio/ops/connections.rs b/src/openhuman/integrations/composio/ops/connections.rs
index 416f2fa43c..dd3330ebb1 100644
--- a/src/openhuman/integrations/composio/ops/connections.rs
+++ b/src/openhuman/integrations/composio/ops/connections.rs
@@ -2,8 +2,8 @@
use std::collections::HashMap;
+use super::super::module_client::{self as connectors, methods};
use crate::openhuman::config::Config;
-use crate::openhuman::modules::connectors::{self, methods};
use crate::rpc::RpcOutcome;
use super::super::client::ComposioClient;
diff --git a/src/openhuman/integrations/composio/ops/toolkits.rs b/src/openhuman/integrations/composio/ops/toolkits.rs
index 46c17c900e..a8b59493cd 100644
--- a/src/openhuman/integrations/composio/ops/toolkits.rs
+++ b/src/openhuman/integrations/composio/ops/toolkits.rs
@@ -1,7 +1,7 @@
//! Toolkit and capability listing ops.
+use super::super::module_client::{self as connectors, methods};
use crate::openhuman::config::Config;
-use crate::openhuman::modules::connectors::{self, methods};
use crate::rpc::RpcOutcome;
use super::super::providers::{agent_ready_toolkits, capability_matrix};
diff --git a/src/openhuman/modules/connectors.rs b/src/openhuman/modules/connectors.rs
index 0fbd3c7e25..e55001368d 100644
--- a/src/openhuman/modules/connectors.rs
+++ b/src/openhuman/modules/connectors.rs
@@ -177,22 +177,6 @@ pub async fn call_bare<Reply: DeserializeOwned>(
.map_err(|error| format!("{member}: {error}"))
}
-/// Whether a member failure is the module refusing an operation the live route
-/// does not offer.
-///
-/// The two routes are not equivalent, and the module says so by name rather
-/// than by returning an empty result. A host that wants to render its own
-/// message for that case — "direct mode has no curated allowlist" — needs to
-/// tell the refusal apart from a real failure, and this is how.
-///
-/// Matched on the message because that is what crosses the bus: `TinyBus`
-/// carries an error name and a string, not a typed enum, so the structure of
-/// [`tinyconnectors_bus`]'s error is flattened by the time it arrives.
-#[must_use]
-pub fn is_unsupported_by_route(error: &str) -> bool {
- error.contains("is not available over the") && error.contains("route")
-}
-
#[cfg(test)]
#[path = "connectors_tests.rs"]
mod tests;
diff --git a/src/openhuman/modules/connectors_tests.rs b/src/openhuman/modules/connectors_tests.rs
index abbf1b0e8d..2d471734cb 100644
--- a/src/openhuman/modules/connectors_tests.rs
+++ b/src/openhuman/modules/connectors_tests.rs
@@ -1,6 +1,6 @@
//! Tests for the connector module client.
-use super::{is_unsupported_by_route, methods, module_config, MODULE_ID};
+use super::{methods, module_config, MODULE_ID};
use crate::openhuman::config::schema::{COMPOSIO_MODE_BACKEND, COMPOSIO_MODE_DIRECT};
use crate::openhuman::config::Config;
use crate::openhuman::modules::registry;
@@ -145,30 +145,3 @@ fn the_backend_route_needs_a_session() {
let error = module_config(&config).expect_err("no session token");
assert!(error.contains("Sign in"), "{error}");
}
-
-#[test]
-fn recognises_the_module_refusing_a_member_its_route_cannot_serve() {
- // The two routes are not equivalent, and the module says so by name rather
- // than returning an empty result. A host rendering its own message for that
- // case has to tell the refusal apart from a real failure.
- assert!(is_unsupported_by_route(
- "ListToolkits: ListToolkits is not available over the direct route"
- ));
- assert!(is_unsupported_by_route(
- "DeleteConnection is not available over the direct route"
- ));
-}
-
-#[test]
-fn does_not_mistake_a_real_failure_for_a_route_refusal() {
- // Getting this wrong would render "no curated allowlist" over a genuine
- // outage, and the user would never learn their integration was broken.
- for error in [
- "ListToolkits: request to /agent-integrations/composio/toolkits failed: 502 bad gateway",
- "ListToolkits: response did not match the contract",
- "unknown module 'tinyconnectors'",
- "the module runtime is unavailable",
- ] {
- assert!(!is_unsupported_by_route(error), "{error}");
- }
-}