Skip to content

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

fix(composio): restore missing client module re-export

Steven Enamakeld72718739211
diff --git a/crates/openhuman-core/src/integrations/composio/client.rs b/crates/openhuman-core/src/integrations/composio/client.rs
index 649dca3db4..dc828a8f84 100644
--- a/crates/openhuman-core/src/integrations/composio/client.rs
+++ b/crates/openhuman-core/src/integrations/composio/client.rs
@@ -20,7 +20,7 @@ mod triggers;
mod tests;
pub use connections::ComposioClient;
-pub(crate) use direct::{direct_authorize, direct_list_tools};
+pub(crate) use direct::direct_list_tools;
pub use direct::direct_list_connections;
pub(crate) use factory::{build_composio_client, create_direct_composio_tool_for_api_key};
pub use factory::{create_composio_client, ComposioClientKind};
diff --git a/crates/openhuman-core/src/integrations/composio/client/direct.rs b/crates/openhuman-core/src/integrations/composio/client/direct.rs
index b9abacef45..b48c1073d0 100644
--- a/crates/openhuman-core/src/integrations/composio/client/direct.rs
+++ b/crates/openhuman-core/src/integrations/composio/client/direct.rs
@@ -1,5 +1,4 @@
-//! Direct-mode response reshapers: `direct_authorize`,
-//! `direct_list_connections`, and `direct_list_tools`. Mirror the
+//! Direct-mode response reshapers: `direct_list_connections`, and `direct_list_tools`. Mirror the
//! backend-proxied [`super::connections::ComposioClient`] methods but call
//! Composio's v3 API directly (via a bound [`crate::tools::ComposioTool`])
//! and reshape the v3 response into the same envelope types, so downstream
@@ -9,61 +8,9 @@ use std::sync::Arc;
use super::super::direct_auth;
use super::super::types::{
- ComposioAuthorizeResponse, ComposioConnection, ComposioConnectionsResponse,
- ComposioExecuteResponse, ComposioToolsResponse,
+ ComposioConnection, ComposioConnectionsResponse, ComposioToolsResponse,
};
-/// Direct-mode counterpart to [`ComposioClient::authorize`]. Calls
-/// Composio v3 `/connected_accounts/link` via
-/// [`crate::tools::ComposioTool::get_connection_url`] and
-/// reshapes the response into the [`ComposioAuthorizeResponse`] the
-/// backend-proxied path emits.
-///
-/// The v3 endpoint returns a redirect URL but does NOT (currently)
-/// surface a stable `connection_id` in the same call — the connection
-/// row is created lazily when the user completes OAuth on Composio's
-/// hosted page. To preserve the response contract the frontend already
-/// consumes, we emit an empty `connection_id` for now. The 5 s
-/// `list_connections` poll (now live in direct mode too — see
-/// [`direct_list_connections`]) is what ultimately surfaces the new
-/// row to the UI.
-pub(crate) async fn direct_authorize(
- direct: &Arc<crate::tools::ComposioTool>,
- toolkit: &str,
- entity_id: &str,
-) -> anyhow::Result<ComposioAuthorizeResponse> {
- let toolkit = toolkit.trim();
- if toolkit.is_empty() {
- anyhow::bail!("composio direct authorize: toolkit must not be empty");
- }
- let entity_id = entity_id.trim();
- let entity_id = if entity_id.is_empty() {
- "default"
- } else {
- entity_id
- };
- tracing::debug!(
- toolkit = %toolkit,
- entity_id = %entity_id,
- "[composio-direct] authorize: requesting hosted connect URL"
- );
- let connect_url = direct
- .get_connection_url(Some(toolkit), None, entity_id)
- .await?;
- tracing::debug!(
- toolkit = %toolkit,
- url_len = connect_url.len(),
- "[composio-direct] authorize: got connect url (redacted)"
- );
- Ok(ComposioAuthorizeResponse {
- connect_url,
- // No stable connection id in the v3 link response — see fn-level
- // doc. The frontend uses `connectUrl` to open the browser and
- // `listConnections` polling to detect the resulting row.
- connection_id: String::new(),
- })
-}
-
/// Direct-mode counterpart to [`ComposioClient::list_connections`].
///
/// Calls Composio v3 `/connected_accounts` (via
diff --git a/crates/openhuman-core/src/integrations/composio/client_triggers_and_factory_tests.rs b/crates/openhuman-core/src/integrations/composio/client_triggers_and_factory_tests.rs
index f5efb137dc..25d8b20e25 100644
--- a/crates/openhuman-core/src/integrations/composio/client_triggers_and_factory_tests.rs
+++ b/crates/openhuman-core/src/integrations/composio/client_triggers_and_factory_tests.rs
@@ -365,19 +365,6 @@ async fn direct_list_connections_stops_hitting_composio_after_repeated_invalid_a
);
}
-#[tokio::test]
-async fn direct_authorize_rejects_empty_toolkit() {
- let tool = direct_tool_for_test();
- let err = super::super::direct_authorize(&tool, " ", "default")
- .await
- .err()
- .expect("empty toolkit must error before any HTTP call");
- assert!(
- err.to_string().contains("toolkit must not be empty"),
- "unexpected error: {err}"
- );
-}
-
#[tokio::test]
async fn direct_list_tools_forwards_tags_and_reshapes_v3_envelope() {
use axum::extract::RawQuery;