Skip to content

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

refactor(composio): simplify connection identity lookup

Steven Enamakel5ee821f48b11
diff --git a/crates/openhuman-core/src/integrations/composio/ops/connections.rs b/crates/openhuman-core/src/integrations/composio/ops/connections.rs
index ff8ab07c87..15903580b5 100644
--- a/crates/openhuman-core/src/integrations/composio/ops/connections.rs
+++ b/crates/openhuman-core/src/integrations/composio/ops/connections.rs
@@ -355,12 +355,9 @@ pub(crate) async fn enrich_connections_with_identity(
return resp;
}
};
- let (identity_keys, connection_keys) = normalized.split_at(identities.len() * 2);
- let lookup: HashMap<(String, String), _> = identities
- .iter()
- .zip(identity_keys.chunks(2))
- .map(|(id, keys)| ((keys[0].clone(), keys[1].clone()), id))
- .collect();
+ let connection_keys = normalized[identities.len() * 2..].to_vec();
+ let normalized_keys: HashMap<_, _> = raw.into_iter().zip(normalized).collect();
+ let lookup = identity_lookup(&identities, &normalized_keys);
tracing::debug!(
total = resp.connections.len(),