Skip to content

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

test(composio): cover backend route registration for composio tools

Steven Enamakel9537e3c606f3
diff --git a/crates/openhuman-core/src/modules/connectors_tests.rs b/crates/openhuman-core/src/modules/connectors_tests.rs
index 53ca80a6a2..5a3caced07 100644
--- a/crates/openhuman-core/src/modules/connectors_tests.rs
+++ b/crates/openhuman-core/src/modules/connectors_tests.rs
@@ -164,6 +164,7 @@ fn an_unknown_mode_fails_loudly_and_names_the_alternatives() {
fn an_empty_mode_is_treated_as_the_backend_default() {
// `serde(default)` already gives "backend" for a missing field, but a
// literal empty string in TOML would otherwise be rejected.
+ crate::integrations::composio::test_backend_route::register();
let mut config = bare_config();
config.composio.mode = String::new();
diff --git a/crates/openhuman-core/src/tools/ops_tests_composio_registration_tests.rs b/crates/openhuman-core/src/tools/ops_tests_composio_registration_tests.rs
index 3e7b1b6d99..ec28f54336 100644
--- a/crates/openhuman-core/src/tools/ops_tests_composio_registration_tests.rs
+++ b/crates/openhuman-core/src/tools/ops_tests_composio_registration_tests.rs
@@ -47,3 +47,23 @@ fn composio_tools_stay_unregistered_in_backend_mode_without_an_app_session() {
"backend mode without a session must not register composio tools; got: {names:?}"
);
}
+
+#[test]
+fn composio_tools_register_in_backend_mode_once_a_host_registers_the_route() {
+ crate::integrations::composio::test_backend_route::register();
+ let tmp = TempDir::new().unwrap();
+ let cfg = test_config(&tmp);
+ store_test_session_token(&cfg);
+
+ let names = registry_names_for(&cfg, &tmp);
+ assert_contains_all(
+ &names,
+ &[
+ "composio_list_toolkits",
+ "composio_list_connections",
+ "composio_authorize",
+ "composio_list_tools",
+ "composio_execute",
+ ],
+ );
+}
diff --git a/crates/openhuman-core/src/tools/ops_tests_execution_and_serde_tests.rs b/crates/openhuman-core/src/tools/ops_tests_execution_and_serde_tests.rs
index b5704a4d47..a9c453ec37 100644
--- a/crates/openhuman-core/src/tools/ops_tests_execution_and_serde_tests.rs
+++ b/crates/openhuman-core/src/tools/ops_tests_execution_and_serde_tests.rs
@@ -206,16 +206,11 @@ fn all_tools_registers_no_hosted_integration_families_without_a_tool_source() {
"`{hosted}` must come from a tool source, not the core; got: {names:?}"
);
}
- // Composio registers on the session alone; the route is a host's concern.
- assert_contains_all(
- &names,
- &[
- "composio_list_toolkits",
- "composio_list_connections",
- "composio_authorize",
- "composio_list_tools",
- "composio_execute",
- ],
+ // Composio's backend mode is a route a host registers; a bare core has
+ // none, so a session alone does not register the composio tools.
+ assert!(
+ !names.iter().any(|n| n.starts_with("composio_")),
+ "composio backend mode needs a registered route; got: {names:?}"
);
// The backend retired its Twilio route; the agent must not be offered a
// tool that can only fail.