Skip to content

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

test(flows): add coverage for builder tools, tier gating, and tool results

Steven Enamakel6224630b718d
diff --git a/crates/openhuman-core/src/flows/builder_tools_reads_and_catalog_tests.rs b/crates/openhuman-core/src/flows/builder_tools_reads_and_catalog_tests.rs
index 56c5802ebf..779adc941f 100644
--- a/crates/openhuman-core/src/flows/builder_tools_reads_and_catalog_tests.rs
+++ b/crates/openhuman-core/src/flows/builder_tools_reads_and_catalog_tests.rs
@@ -140,6 +140,9 @@ async fn get_flow_run_missing_id_is_error() {
#[tokio::test]
async fn list_flow_connections_is_read_only() {
+ // Reaches the connector module, whose route is process-wide: hold the module
+ // lock (before TEST_ENV_LOCK, the established order) for the whole test.
+ let _module = crate::integrations::composio::module_client::module_guard().await;
let tmp = TempDir::new().unwrap();
let tool = ListFlowConnectionsTool::new(test_config(&tmp));
assert_eq!(tool.permission_level(), PermissionLevel::None);
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs b/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs
index 65109ea9c3..200d285e8b 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs
@@ -103,6 +103,9 @@ async fn http_adapter_blocks_under_readonly_tier() {
/// `http_request`, and `code` node paths, which all gate on tier first.
#[tokio::test]
async fn composio_tool_call_blocks_under_readonly_tier() {
+ // Reaches the connector module, whose route is process-wide: hold the module
+ // lock (before TEST_ENV_LOCK, the established order) for the whole test.
+ let _module = crate::integrations::composio::module_client::module_guard().await;
use crate::security::AutonomyLevel;
let tools = OpenHumanTools {
@@ -139,6 +142,9 @@ async fn composio_tool_call_blocks_under_readonly_tier() {
/// under a read-only tier.
#[tokio::test]
async fn composio_read_action_allowed_under_readonly_tier() {
+ // Reaches the connector module, whose route is process-wide: hold the module
+ // lock (before TEST_ENV_LOCK, the established order) for the whole test.
+ let _module = crate::integrations::composio::module_client::module_guard().await;
use crate::security::AutonomyLevel;
let class = classify_composio_action_for_tier("TWITTER_RECENT_SEARCH").await;
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/ops_tool_results_and_credentials_tests.rs b/crates/openhuman-core/src/flows/tinyflows/caps/ops_tool_results_and_credentials_tests.rs
index 5457721056..88bffaae4a 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/ops_tool_results_and_credentials_tests.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/ops_tool_results_and_credentials_tests.rs
@@ -156,6 +156,9 @@ fn connection_ref_resolves_to_the_chosen_account() {
/// but simply doesn't contain it.
#[tokio::test]
async fn unknown_toolkit_still_rejects() {
+ // Reaches the connector module, whose route is process-wide: hold the module
+ // lock (before TEST_ENV_LOCK, the established order) for the whole test.
+ let _module = crate::integrations::composio::module_client::module_guard().await;
use crate::integrations::composio::contract::catalog_for_toolkit;
let config = Config::default();
// Precondition: `flowstestkit` is genuinely uncatalogued, so the decision
@@ -201,6 +204,9 @@ async fn unknown_toolkit_still_rejects() {
/// The exact same slug rejects above without a connection.
#[tokio::test]
async fn connected_uncatalogued_toolkit_now_passes() {
+ // Reaches the connector module, whose route is process-wide: hold the module
+ // lock (before TEST_ENV_LOCK, the established order) for the whole test.
+ let _module = crate::integrations::composio::module_client::module_guard().await;
use crate::integrations::composio::contract::catalog_for_toolkit;
assert!(catalog_for_toolkit("flowstestkit").is_none());
@@ -252,6 +258,9 @@ async fn connected_uncatalogued_toolkit_now_passes() {
/// which passes.
#[tokio::test]
async fn expired_live_catalog_entry_is_treated_as_a_cache_miss() {
+ // Reaches the connector module, whose route is process-wide: hold the module
+ // lock (before TEST_ENV_LOCK, the established order) for the whole test.
+ let _module = crate::integrations::composio::module_client::module_guard().await;
use crate::integrations::composio::contract::catalog_for_toolkit;
assert!(catalog_for_toolkit("flowsexpiredkit").is_none());
@@ -290,6 +299,9 @@ async fn expired_live_catalog_entry_is_treated_as_a_cache_miss() {
/// sufficient, the slug itself must be real.
#[tokio::test]
async fn connected_uncatalogued_toolkit_rejects_a_hallucinated_slug() {
+ // Reaches the connector module, whose route is process-wide: hold the module
+ // lock (before TEST_ENV_LOCK, the established order) for the whole test.
+ let _module = crate::integrations::composio::module_client::module_guard().await;
use crate::integrations::composio::contract::catalog_for_toolkit;
assert!(catalog_for_toolkit("flowstestkit").is_none());