Skip to content

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

chore(composio): remove unused test files

Steven Enamakel18e228868730
diff --git a/crates/openhuman-core/src/agent/learning/linkedin_enrichment_tests.rs b/crates/openhuman-core/src/agent/learning/linkedin_enrichment_tests.rs
index 93101f119e..6cd7bd2444 100644
--- a/crates/openhuman-core/src/agent/learning/linkedin_enrichment_tests.rs
+++ b/crates/openhuman-core/src/agent/learning/linkedin_enrichment_tests.rs
@@ -47,7 +47,7 @@ fn handles_no_match() {
// session JWT was rejected at the very first line ("composio client
// unavailable") — silently disabling LinkedIn enrichment for that user
// even when their personal Composio tenant had a healthy Gmail
-// connection. The function now resolves via `create_composio_client`
+// connection. The function now resolves via `resolve_composio_route`
// and branches on the kind.
//
// These tests exercise the factory branch shape against synthetic
@@ -59,7 +59,7 @@ fn handles_no_match() {
#[tokio::test]
async fn search_gmail_for_linkedin_routes_through_factory_in_direct_mode() {
- use crate::integrations::composio::client::{create_composio_client, ComposioClientKind};
+ use crate::integrations::composio::client::{resolve_composio_route, ComposioRoute};
let tmp = tempfile::tempdir().expect("tempdir");
let mut config = crate::config::Config::default();
config.config_path = tmp.path().join("config.toml");
@@ -68,13 +68,13 @@ async fn search_gmail_for_linkedin_routes_through_factory_in_direct_mode() {
// Factory probe: a direct-mode config with an inline key resolves
// to the `Direct` variant. The smoke is that `search_gmail_for_linkedin`'s
- // first action is now to call `create_composio_client` (which
+ // first action is now to call `resolve_composio_route` (which
// succeeds here) — instead of `build_composio_client` which would
// unconditionally return `None` for a config with no backend
// session and fail the function before any branching could happen.
- let kind = create_composio_client(&config).expect("direct-mode probe should succeed");
+ let kind = resolve_composio_route(&config).expect("direct-mode probe should succeed");
assert!(
- matches!(kind, ComposioClientKind::Direct(_)),
+ matches!(kind, ComposioRoute::Direct(_)),
"direct-mode config must resolve to Direct variant"
);
}
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops_tests_model_resolution_tests.rs b/crates/openhuman-core/src/agent/subagent_host/ops_tests_model_resolution_tests.rs
index 295fcf0334..6f815d977a 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops_tests_model_resolution_tests.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops_tests_model_resolution_tests.rs
@@ -483,7 +483,7 @@ fn direct_mode_user_with_stored_key_passes_signed_in_check() {
let mut config = crate::config::Config::default();
config.config_path = tmp.path().join("config.toml");
// Direct mode + inline API key (the `config.composio.api_key`
- // fallback path inside `create_composio_client` — equivalent to a
+ // fallback path inside `resolve_composio_route` — equivalent to a
// stored direct key as far as the probe is concerned).
config.composio.mode = crate::config::schema::COMPOSIO_MODE_DIRECT.to_string();
config.composio.api_key = Some("test-direct-key".into());
diff --git a/crates/openhuman-core/src/integrations/composio/action_tool_tests.rs b/crates/openhuman-core/src/integrations/composio/action_tool_tests.rs
index 2216a063d8..7b093f76f4 100644
--- a/crates/openhuman-core/src/integrations/composio/action_tool_tests.rs
+++ b/crates/openhuman-core/src/integrations/composio/action_tool_tests.rs
@@ -303,7 +303,7 @@ fn contract_gate_surfaces_full_contract_then_proceeds_on_retry() {
// honoured on the very next per-action execute.
// These two tests assert the *factory routing decision* by mode. They
-// call `create_composio_client(&Config)` directly — the pure routing
+// call `resolve_composio_route(&Config)` directly — the pure routing
// function — instead of going through `tool.execute()`, which reloads
// config via `load_config_with_timeout()` (reads `OPENHUMAN_WORKSPACE`)
// and was therefore subject to a parallel-test env-var race: another
@@ -321,9 +321,9 @@ fn factory_routes_through_backend_when_mode_is_backend() {
config.config_path = tmp.path().join("config.toml");
config.workspace_dir = tmp.path().join("workspace");
- // `ComposioClientKind` isn't `Debug`, so match rather than
+ // `ComposioRoute` isn't `Debug`, so match rather than
// `expect_err` (which would need to format the unexpected `Ok`).
- let msg = match crate::integrations::composio::client::create_composio_client(&config) {
+ let msg = match crate::integrations::composio::client::resolve_composio_route(&config) {
Ok(_) => panic!("backend mode with no session must error, but a client resolved"),
Err(e) => e.to_string(),
};
@@ -349,12 +349,12 @@ fn factory_routes_through_direct_when_mode_is_direct() {
// Direct mode + an api key must resolve to the Direct variant —
// never the backend branch. (Deterministic: pure factory call, no
// env / reload / await; see the note on the backend test.)
- let kind = crate::integrations::composio::client::create_composio_client(&config)
+ let kind = crate::integrations::composio::client::resolve_composio_route(&config)
.expect("direct mode with an api key must resolve");
assert!(
matches!(
kind,
- crate::integrations::composio::client::ComposioClientKind::Direct(_)
+ crate::integrations::composio::client::ComposioRoute::Direct(_)
),
"direct-mode config must route to the Direct client, not backend"
);
diff --git a/crates/openhuman-core/src/integrations/composio/client_tests.rs b/crates/openhuman-core/src/integrations/composio/client_tests.rs
index 87bd3bec4e..3aea2a3773 100644
--- a/crates/openhuman-core/src/integrations/composio/client_tests.rs
+++ b/crates/openhuman-core/src/integrations/composio/client_tests.rs
@@ -307,7 +307,7 @@ async fn direct_list_tools_forwards_tags_and_reshapes_v3_envelope() {
let base = start_mock_backend(app).await;
let tool = direct_tool_for_mock(base);
- let resp = super::super::direct_list_tools(
+ let resp = super::direct_list_tools(
&tool,
&["github".to_string()],
Some(&["stars".to_string(), "repos".to_string()]),
diff --git a/crates/openhuman-core/src/integrations/composio/ops/mod.rs b/crates/openhuman-core/src/integrations/composio/ops/mod.rs
index 25cf5fef3a..70d5c59d14 100644
--- a/crates/openhuman-core/src/integrations/composio/ops/mod.rs
+++ b/crates/openhuman-core/src/integrations/composio/ops/mod.rs
@@ -12,7 +12,7 @@
//!
//! | Sub-module | Contents |
//! |-------------------|--------------------------------------------------------------------|
-//! | `error_utils` | `OpResult`, `resolve_client`, `report_composio_op_error`, helpers |
+//! | `error_utils` | `OpResult`, `report_composio_op_error`, helpers |
//! | `toolkits` | `composio_list_toolkits`, `composio_list_capabilities`, ... |
//! | `connections` | `composio_list_connections`, `composio_authorize`, `_delete_...` |
//! | `memory_cleanup` | Memory-cleanup helpers for connection deletion |
@@ -114,7 +114,7 @@ pub(crate) use connections::enrich_connections_with_identity;
#[cfg(test)]
pub(crate) use error_utils::{
backend_mode_without_session, classify_composio_failure_tag, direct_mode_without_key,
- extract_backend_returned_status, resolve_client,
+ extract_backend_returned_status,
};
#[cfg(test)]
pub(crate) use providers_ops::parse_sync_reason;
diff --git a/crates/openhuman-core/src/integrations/composio/ops_no_session_and_cache_tests.rs b/crates/openhuman-core/src/integrations/composio/ops_no_session_and_cache_tests.rs
index 64991dd152..96c4c9853f 100644
--- a/crates/openhuman-core/src/integrations/composio/ops_no_session_and_cache_tests.rs
+++ b/crates/openhuman-core/src/integrations/composio/ops_no_session_and_cache_tests.rs
@@ -27,19 +27,6 @@ fn parse_sync_reason_rejects_unknown_values() {
assert!(parse_sync_reason(Some("")).is_err());
}
-#[test]
-fn resolve_client_errors_without_session() {
- let tmp = tempfile::tempdir().unwrap();
- let config = test_config(&tmp);
- // `ComposioClient` intentionally doesn't implement `Debug` — use a
- // pattern match instead of `.unwrap_err()`.
- let Err(err) = resolve_client(&config) else {
- panic!("expected auth error when no session is stored");
- };
- assert!(err.contains("composio unavailable"));
- assert!(err.contains("TinyHumans API key"));
-}
-
#[tokio::test]
async fn composio_list_toolkits_errors_without_session() {
let _serialised = module_guard().await;
@@ -121,7 +108,7 @@ async fn composio_authorize_errors_without_session() {
.unwrap_err();
// Backend mode (default) without a session — the mode-aware factory
// surfaces "no backend session token" once `composio_authorize`
- // routes through `create_composio_client`. Accept either the
+ // routes through `resolve_composio_route`. Accept either the
// legacy `composio unavailable` prefix or the new factory phrasing.
assert!(
err.to_lowercase().contains("composio")
diff --git a/crates/openhuman-core/src/integrations/composio/ops_tests.rs b/crates/openhuman-core/src/integrations/composio/ops_tests.rs
index 7f78fb94e8..c2c0e35e93 100644
--- a/crates/openhuman-core/src/integrations/composio/ops_tests.rs
+++ b/crates/openhuman-core/src/integrations/composio/ops_tests.rs
@@ -3,7 +3,7 @@ use crate::agent::prompts::IntegrationConnection;
use crate::integrations::composio::module_client::module_guard;
-// ── resolve_client / ops auth errors ──────────────────────────
+// ── ops auth errors ──────────────────────────
fn test_config(tmp: &tempfile::TempDir) -> Config {
let mut c = Config::default();
@@ -272,7 +272,7 @@ fn conn(id: &str, toolkit: &str, status: &str) -> super::super::types::ComposioC
// where the data is (or isn't) coming from.
/// Set up a config with `composio.mode = "direct"` and a stored
-/// direct-mode API key (so `create_composio_client` succeeds).
+/// direct-mode API key (so `resolve_composio_route` succeeds).
fn direct_mode_config(tmp: &tempfile::TempDir) -> Config {
let mut c = Config::default();
c.workspace_dir = tmp.path().join("workspace");
diff --git a/crates/openhuman-core/src/integrations/composio/tools_direct_mode_routing_tests.rs b/crates/openhuman-core/src/integrations/composio/tools_direct_mode_routing_tests.rs
index 7fc37d2752..6b34f755df 100644
--- a/crates/openhuman-core/src/integrations/composio/tools_direct_mode_routing_tests.rs
+++ b/crates/openhuman-core/src/integrations/composio/tools_direct_mode_routing_tests.rs
@@ -33,7 +33,7 @@ fn execute_tool_resolves_to_direct_kind_when_mode_is_direct() {
// breakage. We assert by independently calling the same factory the
// tool calls per-execute.
let config = direct_mode_config();
- let kind = crate::integrations::composio::client::create_composio_client(&config)
+ let kind = crate::integrations::composio::client::resolve_composio_route(&config)
.expect("direct mode with inline api_key must resolve");
assert_eq!(
kind.mode(),
@@ -46,7 +46,7 @@ fn execute_tool_resolves_to_direct_kind_when_mode_is_direct() {
fn execute_tool_resolves_to_backend_kind_when_mode_is_backend() {
// Reverse of the above — confirms the backend path still wins when
// the user is on default (mode = "backend") and a session token is
- // present. Without the token, `create_composio_client` returns
+ // present. Without the token, `resolve_composio_route` returns
// Err("no backend session"); store one to get past that gate.
let tmp = tempfile::tempdir().unwrap();
let mut config = crate::config::Config::default();
@@ -60,7 +60,7 @@ fn execute_tool_resolves_to_backend_kind_when_mode_is_backend() {
true,
)
.expect("store test session token");
- let kind = crate::integrations::composio::client::create_composio_client(&config)
+ let kind = crate::integrations::composio::client::resolve_composio_route(&config)
.expect("backend mode with session token must resolve");
assert_eq!(
kind.mode(),
@@ -229,14 +229,14 @@ async fn list_toolkits_in_direct_mode_returns_empty_without_hitting_backend() {
#[test]
fn list_connections_in_direct_mode_resolves_to_direct_client_kind() {
// Verifies the routing property without making a network call:
- // when mode=direct with an inline api_key, create_composio_client
+ // when mode=direct with an inline api_key, resolve_composio_route
// returns a Direct variant. The list_connections tool uses the same
// factory call, so if the factory picks Direct the tool will route
// to direct_list_connections (not the backend short-circuit).
// Previously the tool short-circuited to empty-success in direct mode
// which caused the agent to incorrectly see no connections (#1710).
let config = direct_mode_config();
- let kind = crate::integrations::composio::client::create_composio_client(&config)
+ let kind = crate::integrations::composio::client::resolve_composio_route(&config)
.expect("direct mode with inline api_key must resolve");
assert_eq!(
kind.mode(),
diff --git a/crates/openhuman-core/src/integrations/composio/tools_host_credential_tests.rs b/crates/openhuman-core/src/integrations/composio/tools_host_credential_tests.rs
index a16f6e232a..6691174c5e 100644
--- a/crates/openhuman-core/src/integrations/composio/tools_host_credential_tests.rs
+++ b/crates/openhuman-core/src/integrations/composio/tools_host_credential_tests.rs
@@ -8,7 +8,7 @@ use serde_json::{json, Value};
use tinytools::Tool;
use crate::config::{ComposioHostCredential, Config};
-use crate::integrations::composio::client::{create_composio_client, ComposioClientKind};
+use crate::integrations::composio::client::{resolve_composio_route, ComposioRoute};
use crate::integrations::composio::connected_integrations::{
cache_key, composio_cache_test_lock, CachedIntegrations, INTEGRATIONS_CACHE,
};
@@ -95,9 +95,9 @@ fn pinned(base: &Config, key: &str, entity: &str, mock: Option<&str>) -> Config
}
fn direct_key_fingerprint(config: &Config) -> u64 {
- match create_composio_client(config).expect("pinned credential resolves") {
- ComposioClientKind::Direct(tool) => tool.auth_key_fingerprint(),
- ComposioClientKind::Backend(_) => panic!("a pinned credential must resolve direct"),
+ match resolve_composio_route(config).expect("pinned credential resolves") {
+ ComposioRoute::Direct(tool) => tool.auth_key_fingerprint(),
+ ComposioRoute::Backend => panic!("a pinned credential must resolve direct"),
}
}
diff --git a/crates/openhuman-core/src/integrations/composio/tools_tests.rs b/crates/openhuman-core/src/integrations/composio/tools_tests.rs
index adf7127035..90b7044caa 100644
--- a/crates/openhuman-core/src/integrations/composio/tools_tests.rs
+++ b/crates/openhuman-core/src/integrations/composio/tools_tests.rs
@@ -55,7 +55,7 @@ impl Drop for WorkspaceEnvGuard {
/// Minimal `Arc<Config>` for the agent-tool constructors. All five
/// composio agent tools now resolve their client per call through
-/// `create_composio_client(&config)` rather than holding a pre-baked
+/// `resolve_composio_route(&config)` rather than holding a pre-baked
/// handle, so a `Config` is sufficient to instantiate them.
///
/// Config defaults set `composio.mode = "backend"` and stash a
@@ -112,7 +112,7 @@ fn error_text(result: &ToolResult) -> String {
//
// These tests guard the bug-fix where every composio agent tool used
// to hold a pre-baked backend client. After the fix, all five tools
-// resolve the client through `create_composio_client` per call so the
+// resolve the client through `resolve_composio_route` per call so the
// live `composio.mode` toggle is honoured. Read-shaped tools
// (list_toolkits, list_connections, list_tools) short-circuit to an
// empty response in direct mode mirroring the existing ops.rs
diff --git a/crates/openhuman-core/src/modules/memory_host_tests.rs b/crates/openhuman-core/src/modules/memory_host_tests.rs
index 77132980be..398f2e9434 100644
--- a/crates/openhuman-core/src/modules/memory_host_tests.rs
+++ b/crates/openhuman-core/src/modules/memory_host_tests.rs
@@ -21,7 +21,7 @@ use super::{
COMPOSIO_PATH, EMBEDDING_NAME, EMBEDDING_PATH, RUNTIME_NAME, RUNTIME_PATH,
};
use crate::config::Config;
-use crate::integrations::composio::client::create_composio_client;
+use crate::integrations::composio::client::resolve_composio_route;
use serde_json::json;
use std::path::Path;
use std::sync::Arc;
@@ -154,7 +154,7 @@ async fn composio_answers_over_the_bus_and_not_only_in_process() {
.expect("proxy");
let available: bool = proxy.call("IsAvailable", ()).await.expect("IsAvailable");
- assert_eq!(available, create_composio_client(config.as_ref()).is_ok());
+ assert_eq!(available, resolve_composio_route(config.as_ref()).is_ok());
}
#[tokio::test]
@@ -171,7 +171,7 @@ async fn is_available_is_the_hosts_own_factory_probe() {
.expect("IsAvailable never fails");
assert_eq!(
answer,
- json!(create_composio_client(config.as_ref()).is_ok())
+ json!(resolve_composio_route(config.as_ref()).is_ok())
);
}
@@ -191,7 +191,7 @@ async fn api_key_is_the_hosts_own_credential_store() {
}
/// `api_key` falls back to `config.composio.api_key` when the credential store
-/// holds nothing, keeping parity with `create_composio_client`'s fallback so
+/// holds nothing, keeping parity with `resolve_composio_route`'s fallback so
/// `is_available` and `api_key` cannot disagree for a direct-mode user.
#[tokio::test]
async fn api_key_falls_back_to_config_key_when_credential_store_is_empty() {