Skip to content

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

test(composio): add tests for disabled mode behaviour

Steven Enamakel9d21bf65f620
diff --git a/crates/openhuman-core/src/integrations/composio/client_tests.rs b/crates/openhuman-core/src/integrations/composio/client_tests.rs
index 9ab9873cdb..9325d26b6d 100644
--- a/crates/openhuman-core/src/integrations/composio/client_tests.rs
+++ b/crates/openhuman-core/src/integrations/composio/client_tests.rs
@@ -101,6 +101,32 @@ fn resolve_composio_route_backend_empty_mode_falls_back_to_backend() {
assert_eq!(route.mode(), "backend");
}
+#[test]
+fn resolve_composio_route_disabled_errors_even_with_a_session() {
+ // `disabled` wins over a signed-in session: no route, so no tools register.
+ let tmp = tempfile::tempdir().expect("tempdir");
+ let mut config = config_with_session_token(&tmp);
+ config.composio.mode = "disabled".into();
+ let err = resolve_composio_route(&config)
+ .err()
+ .expect("disabled must not resolve a route");
+ assert!(err.to_string().contains("disabled"), "got: {err}");
+}
+
+#[tokio::test]
+async fn disabled_mode_reports_no_integrations_without_a_backend_call() {
+ use crate::integrations::composio::{
+ fetch_connected_integrations_status, FetchConnectedIntegrationsStatus,
+ };
+ // Default config would try the hosted backend; disabled must answer locally.
+ let mut config = Config::default();
+ config.composio.mode = "disabled".into();
+ match fetch_connected_integrations_status(&config).await {
+ FetchConnectedIntegrationsStatus::Authoritative(v) => assert!(v.is_empty()),
+ FetchConnectedIntegrationsStatus::Unavailable => panic!("expected authoritative empty"),
+ }
+}
+
#[test]
fn resolve_composio_route_backend_errors_without_session() {
// Backend mode requires the app-session JWT — without it the