Skip to content

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

fix(composio): correct tool type field name in construction

Steven Enamakel15291bfa18dd
diff --git a/crates/openhuman-core/src/integrations/composio/tools/direct/construction.rs b/crates/openhuman-core/src/integrations/composio/tools/direct/construction.rs
index d3ca8a1968..35ee21b522 100644
--- a/crates/openhuman-core/src/integrations/composio/tools/direct/construction.rs
+++ b/crates/openhuman-core/src/integrations/composio/tools/direct/construction.rs
@@ -1,32 +1,17 @@
//! Constructors and the small per-request setup helpers (`client`,
-//! `ensure_request_url`) that every other `DirectComposioClient` impl block relies on.
+//! `ensure_request_url`) that every other `DirectComposioClient` impl block
+//! relies on.
-use super::types::{ensure_https, is_loopback_http_url, DirectComposioClient, COMPOSIO_API_BASE_V3};
+use super::types::{
+ ensure_https, is_loopback_http_base, is_loopback_http_url, DirectComposioClient,
+ COMPOSIO_API_BASE_V3,
+};
use reqwest::Client;
-use super::types::is_loopback_http_base;
-
-pub(super) fn normalize_entity_id(entity_id: &str) -> String {
- let trimmed = entity_id.trim();
- if trimmed.is_empty() {
- "default".to_string()
- } else {
- trimmed.to_string()
- }
-}
-
impl DirectComposioClient {
- pub fn new(
- api_key: &str,
- default_entity_id: Option<&str>,
- ) -> Self {
- // Production always pins the real HTTPS endpoints.
- Self::new_internal(
- api_key,
- default_entity_id,
- COMPOSIO_API_BASE_V3.to_string(),
- false,
- )
+ pub fn new(api_key: &str) -> Self {
+ // Production always pins the real HTTPS endpoint.
+ Self::new_internal(api_key, COMPOSIO_API_BASE_V3.to_string(), false)
}
pub(crate) fn auth_key_fingerprint(&self) -> u64 {
@@ -34,12 +19,14 @@ impl DirectComposioClient {
}
/// Debug-test seam for raw integration coverage: construct a direct
- /// Composio tool against explicit v2/v3 base URLs. Non-HTTPS URLs are
+ /// Composio client against explicit v2/v3 base URLs. Non-HTTPS URLs are
/// accepted only for loopback hosts and only in debug builds.
+ ///
+ /// The v2 root is validated for the same safety rule but not stored: no
+ /// remaining request path uses it.
#[cfg(debug_assertions)]
pub fn new_with_base_urls_for_loopback(
api_key: &str,
- default_entity_id: Option<&str>,
base_v2: String,
base_v3: String,
) -> anyhow::Result<Self> {
@@ -48,19 +35,13 @@ impl DirectComposioClient {
anyhow::bail!("debug Composio base URL must be HTTPS or loopback HTTP");
}
}
- Ok(Self::new_internal(
- api_key,
- default_entity_id,
- base_v3,
- true,
- ))
+ Ok(Self::new_internal(api_key, base_v3, true))
}
/// Construct against explicit v2/v3 API roots. Both must be HTTPS;
/// loopback HTTP is accepted only in debug builds.
pub fn new_with_base_urls(
api_key: &str,
- default_entity_id: Option<&str>,
base_v2: String,
base_v3: String,
) -> anyhow::Result<Self> {
@@ -72,12 +53,7 @@ impl DirectComposioClient {
anyhow::bail!("Composio base URL must be HTTPS");
}
}
- Ok(Self::new_internal(
- api_key,
- default_entity_id,
- base_v3,
- allow_loopback,
- ))
+ Ok(Self::new_internal(api_key, base_v3, allow_loopback))
}
/// Test-only seam: construct with an explicit Composio v3 base URL so
@@ -90,28 +66,14 @@ impl DirectComposioClient {
/// uses the HTTPS [`COMPOSIO_API_BASE_V3`] const. An injectable base must
/// never carry a non-HTTPS URL outside tests.
#[cfg(test)]
- pub(crate) fn new_with_v3_base(
- api_key: &str,
- default_entity_id: Option<&str>,
- base_v3: String,
- ) -> Self {
- Self::new_internal(
- api_key,
- default_entity_id,
- base_v3,
- true,
- )
+ pub(crate) fn new_with_v3_base(api_key: &str, base_v3: String) -> Self {
+ Self::new_internal(api_key, base_v3, true)
}
/// Shared constructor body. Private so the injectable `base_v3` cannot be
/// supplied by production callers — they go through [`Self::new`] (real
/// HTTPS const) and tests through the `#[cfg(test)]` `new_with_v3_base`.
- fn new_internal(
- api_key: &str,
- default_entity_id: Option<&str>,
- base_v3: String,
- allow_insecure_loopback: bool,
- ) -> Self {
+ fn new_internal(api_key: &str, base_v3: String, allow_insecure_loopback: bool) -> Self {
let trimmed = api_key.trim();
if trimmed.len() != api_key.len() {
// The key carried leading/trailing whitespace that would otherwise
@@ -128,7 +90,6 @@ impl DirectComposioClient {
}
Self {
api_key: trimmed.to_string(),
- default_entity_id: normalize_entity_id(default_entity_id.unwrap_or("default")),
base_v3,
allow_insecure_loopback,
}
diff --git a/crates/openhuman-core/src/integrations/composio/tools/direct/types.rs b/crates/openhuman-core/src/integrations/composio/tools/direct/types.rs
index 852e0b4345..b2982534d5 100644
--- a/crates/openhuman-core/src/integrations/composio/tools/direct/types.rs
+++ b/crates/openhuman-core/src/integrations/composio/tools/direct/types.rs
@@ -49,7 +49,6 @@ pub(super) fn is_loopback_http_base(url: &str) -> bool {
/// pre-store API-key probe.
pub struct DirectComposioClient {
pub(super) api_key: String,
- pub(super) default_entity_id: String,
/// Base URL for Composio v3 endpoints (`{base}/tools`). Production
/// always uses [`COMPOSIO_API_BASE_V3`] via [`DirectComposioClient::new`];
/// the `#[cfg(test)]` `new_with_v3_base` constructor lets unit tests point