Skip to content

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

test(raw_coverage): replace direct account assertions with toolkit slug checks

Steven Enamakel24a862ef2f19
diff --git a/tests/raw_coverage/composio_tools_direct_raw_coverage_e2e.rs b/tests/raw_coverage/composio_tools_direct_raw_coverage_e2e.rs
index 8685f4fbec..7b318cc7fc 100644
--- a/tests/raw_coverage/composio_tools_direct_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/composio_tools_direct_raw_coverage_e2e.rs
@@ -46,16 +46,6 @@ async fn direct_composio_client_uses_loopback_for_connected_accounts() {
.expect("loopback direct client"),
);
- let accounts = tool
- .list_connected_accounts()
- .await
- .expect("connected accounts");
- assert_eq!(accounts.len(), 4);
- assert_eq!(accounts[0].toolkit_slug().as_deref(), Some("gmail"));
- assert_eq!(accounts[1].toolkit_slug().as_deref(), Some("github"));
- assert_eq!(accounts[2].toolkit_slug().as_deref(), Some("slack"));
- assert_eq!(accounts[3].toolkit_slug(), None);
-
let mapped = direct_list_connections(&tool)
.await
.expect("mapped connected accounts");
@@ -64,6 +54,16 @@ async fn direct_composio_client_uses_loopback_for_connected_accounts() {
.connections
.iter()
.any(|conn| conn.id == "acct-github" && conn.toolkit == "github"));
+ // Slug extraction: padded string, nested object, `appName` fallback, and a
+ // row with no recognizable slug is kept with an empty toolkit.
+ let toolkits: Vec<&str> = mapped
+ .connections
+ .iter()
+ .map(|c| c.toolkit.as_str())
+ .collect();
+ assert_eq!(toolkits[..2], ["gmail", "github"]);
+ assert_eq!(toolkits[2], "slack");
+ assert_eq!(toolkits[3], "");
let requests = state.requests.lock().expect("requests").clone();
assert!(requests.iter().all(|request| {