Skip to content

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

fix(raw_coverage): add e2e tests for owned domain and composio network leftovers

Steven Enamakela548f298026e
diff --git a/tests/raw_coverage/owned_domain_raw_coverage_e2e.rs b/tests/raw_coverage/owned_domain_raw_coverage_e2e.rs
index c2b948f8bb..236f37390a 100644
--- a/tests/raw_coverage/owned_domain_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/owned_domain_raw_coverage_e2e.rs
@@ -13,7 +13,6 @@ use axum::{Json, Router};
use serde_json::{json, Map, Value};
use tempfile::tempdir;
-use openhuman_core::integrations::composio::ComposioClient;
use openhuman_core::config::{
CapabilityProviderConfig, CapabilityProviderTrustState, Config, McpServerConfig,
};
@@ -328,88 +327,6 @@ fn owned_domain_config(workspace_root: &std::path::Path) -> Config {
config
}
- #[tokio::test]
-async fn composio_client_round_trips_backend_paths_and_payload_normalization() {
- crate::tinyhumans_boot::boot();
- let (base_url, state) = serve_composio_mock().await;
- let client = ComposioClient::new(Arc::new(IntegrationClient::new(
- format!("{base_url}/openai/v1/chat/completions"),
- "jwt-token".to_string(),
- )));
-
- let toolkits = client.list_toolkits().await.expect("toolkits");
- assert_eq!(toolkits.toolkits, vec!["gmail", "github"]);
-
- let tools = client
- .list_tools(
- Some(&[
- " gmail ".to_string(),
- "".to_string(),
- "github repo".to_string(),
- ]),
- Some(&[" mail ".to_string()]),
- )
- .await
- .expect("tools");
- assert_eq!(tools.tools[0].function.name, "GMAIL_SEND_EMAIL");
-
- let authorized = client
- .authorize(
- " gmail ",
- Some(json!({
- "oauth_scopes": "profile https://www.googleapis.com/auth/gmail.readonly"
- })),
- )
- .await
- .expect("authorize");
- assert_eq!(authorized.connection_id, "conn_123");
-
- let triggers = client
- .list_available_triggers(" gmail ", Some("conn 123"))
- .await
- .expect("available triggers");
- assert_eq!(triggers.triggers[0].slug, "GMAIL_NEW_GMAIL_MESSAGE");
-
- let deleted = client
- .delete_connection(" conn_123 ")
- .await
- .expect("delete connection");
- assert!(deleted.deleted);
- assert_eq!(deleted.memory_chunks_deleted, 2);
-
- let requests = state.requests.lock().expect("composio requests").clone();
- assert_eq!(requests[0].3.as_deref(), Some("Bearer jwt-token"));
- assert!(
- requests.iter().any(|(_, path, _, _)| path
- == "/agent-integrations/composio/tools?toolkits=gmail,github%20repo&tags=mail"),
- "list_tools should trim blanks and URL-encode query values: {requests:?}"
- );
- let authorize_body = requests
- .iter()
- .find(|(method, path, _, _)| {
- method == "POST" && path == "/agent-integrations/composio/authorize"
- })
- .and_then(|(_, _, body, _)| body.clone())
- .expect("authorize body");
- assert_eq!(authorize_body.get("toolkit"), Some(&json!("gmail")));
- assert_eq!(
- authorize_body.pointer("/oauth_scopes/0"),
- Some(&json!("profile"))
- );
- assert!(authorize_body["oauth_scopes"]
- .as_array()
- .expect("oauth scopes")
- .iter()
- .any(|scope| scope == "https://www.googleapis.com/auth/gmail.readonly"));
- assert!(
- requests.iter().any(|(method, path, _, _)| {
- method == "DELETE" && path == "/agent-integrations/composio/connections/conn_123"
- }),
- "delete_connection should use DELETE route: {requests:?}"
- );
-}
-
-
#[test]
fn tool_registry_public_apis_cover_entries_diagnostics_and_provider_policy() {
crate::tinyhumans_boot::boot();
diff --git a/tests/raw_coverage/tools_composio_network_leftovers_raw_coverage_e2e.rs b/tests/raw_coverage/tools_composio_network_leftovers_raw_coverage_e2e.rs
index 40d20fe290..4893ec4a3a 100644
--- a/tests/raw_coverage/tools_composio_network_leftovers_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/tools_composio_network_leftovers_raw_coverage_e2e.rs
@@ -23,7 +23,7 @@ use openhuman_core::security::SecurityPolicy;
use tinytools::{Tool, ToolCallOptions};
use openhuman_core::tools::{
ComposioAuthorizeTool, ComposioListConnectionsTool, ComposioListToolkitsTool,
- ComposioListToolsTool, ComposioTool, SpawnSubagentTool};
+ ComposioListToolsTool, SpawnSubagentTool};
static ENV_LOCK: &OnceLock<Mutex<()>> = &crate::SHARED_ENV_LOCK;
@@ -339,129 +339,6 @@ async fn round20_composio_ops_cover_authorize_scopes_and_direct_factory_edges()
.contains("gmail.readonly")));
}
-#[tokio::test]
-async fn round20_direct_composio_tool_covers_fallback_sanitizing_and_account_edges() {
- let _lock = env_lock();
- let state = MockState::default();
- let base = start_loopback(
- Router::new()
- .fallback(any(composio_direct_handler))
- .with_state(state.clone()),
- )
- .await;
- let tool = ComposioTool::new_with_base_urls_for_loopback(
- " ck_round20 ",
- Some(" entity-round20 "),
- Arc::new(SecurityPolicy::default()),
- format!("{base}/api/v2"),
- format!("{base}/api/v3"),
- )
- .expect("loopback direct composio tool");
-
- let insecure_base_error = match ComposioTool::new_with_base_urls_for_loopback(
- "ck",
- None,
- Arc::new(SecurityPolicy::default()),
- "http://example.invalid/api/v2".to_string(),
- format!("{base}/api/v3"),
- ) {
- Ok(_) => panic!("non-loopback http refused"),
- Err(error) => error.to_string(),
- };
- assert!(insecure_base_error.contains("loopback HTTP"));
-
- assert!(!tool.external_effect_with_args(&json!({ "action": "list" })));
- assert!(!tool.external_effect_with_args(&json!({ "action": "connect" })));
- assert!(tool.external_effect_with_args(&json!({ "action": "execute" })));
-
- let actions = tool
- .list_actions(Some(" gmail "))
- .await
- .expect("v3 list actions");
- assert_eq!(actions.len(), 2);
-
- let fallback_actions = tool
- .list_actions(Some("fallback"))
- .await
- .expect("v2 action fallback");
- assert_eq!(fallback_actions[0].name, "FALLBACK_V2");
-
- let failed_list = tool
- .list_actions(Some("broken"))
- .await
- .expect_err("v3 and v2 list fail")
- .to_string();
- assert!(failed_list.contains("v3"));
- assert!(failed_list.contains("v2 fallback"));
-
- let exec = tool
- .execute(json!({
- "action": "execute",
- "action_name": "GMAIL_FETCH_EMAILS",
- "params": { "query": "label:INBOX" },
- "connected_account_id": "acct-gmail"
- }))
- .await
- .expect("tool execute");
- assert!(!exec.is_error);
- assert!(exec.output().contains("msg-round20"));
-
- let failed_exec = tool
- .execute_action(
- "BROKEN_ACTION",
- json!({ "user_id": "secret-user", "connected_account_id": "secret-account" }),
- Some("secret-user"),
- Some("secret-account"),
- )
- .await
- .expect_err("execute failure redacts sensitive field names")
- .to_string();
- assert!(failed_exec.contains("[redacted]"));
- assert!(!failed_exec.contains("connected_account_id"));
- assert!(!failed_exec.contains("user_id"));
-
- let missing_auth_config = tool
- .get_connection_url(Some("missing"), None, "entity-round20")
- .await
- .expect_err("missing auth config");
- assert!(missing_auth_config
- .to_string()
- .contains("No auth config found"));
-
- let connected_accounts = tool
- .list_connected_accounts()
- .await
- .expect("connected accounts");
- assert_eq!(connected_accounts.len(), 3);
- assert_eq!(
- connected_accounts[0].toolkit_slug().as_deref(),
- Some("gmail")
- );
- assert_eq!(
- connected_accounts[1].toolkit_slug().as_deref(),
- Some("github")
- );
- assert_eq!(
- connected_accounts[2].toolkit_slug().as_deref(),
- Some("slack")
- );
-
- let requests = state.requests.lock().expect("requests").clone();
- assert!(requests.iter().all(|request| {
- request.api_key.as_deref() == Some("ck_round20") || request.path == "/health"
- }));
- assert!(requests.iter().any(|request| {
- request.method == Method::GET
- && request.path == "/api/v3/tools"
- && request.query.contains("toolkits=gmail")
- }));
- assert!(requests.iter().any(|request| {
- request.method == Method::POST
- && request.path == "/api/v3/tools/execute/GMAIL_FETCH_EMAILS"
- && request.body.pointer("/connected_account_id") == Some(&json!("acct-gmail"))
- }));
-}
-
#[tokio::test]
async fn round20_spawn_subagent_covers_validation_schema_and_disabled_worker_branch() {
let _lock = env_lock();