The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
test(modules): route fixture clients through ops helper
Steven Enamakel04f50ff20766
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session_juice_tests.rs b/crates/openhuman-core/src/agent/session_host/runtime_session_juice_tests.rsindex 31b8dc5cc2..cd9e07990f 100644--- a/crates/openhuman-core/src/agent/session_host/runtime_session_juice_tests.rs+++ b/crates/openhuman-core/src/agent/session_host/runtime_session_juice_tests.rs@@ -324,5 +324,5 @@ async fn juice_off_turn_loads_no_module_and_passes_tool_output_through() {let err = crate::modules::ensure_loaded_within(&config, "tinyjuice", None).await.unwrap_err();- assert_eq!(err, crate::modules::LoadError::Disabled("juice"));+ assert_eq!(err, tinybus::module::LoadError::Disabled("juice"));}diff --git a/crates/openhuman-core/src/integrations/composio/processing_tests.rs b/crates/openhuman-core/src/integrations/composio/processing_tests.rsindex 003d04658c..08ffb1aacb 100644--- a/crates/openhuman-core/src/integrations/composio/processing_tests.rs+++ b/crates/openhuman-core/src/integrations/composio/processing_tests.rs@@ -65,7 +65,7 @@ async fn preparation_forwards_host_context_and_preserves_module_validation_error.request_name("test.ConnectorProcessing").await.unwrap();- let client = tinybus::module::ModuleClient::fixture(+ let client = crate::modules::ops::fixture_client(caller.proxy("test.ConnectorProcessing",diff --git a/crates/openhuman-core/src/integrations/composio/trigger_history_tests.rs b/crates/openhuman-core/src/integrations/composio/trigger_history_tests.rsindex 2fb046ca5c..91908c3d7e 100644--- a/crates/openhuman-core/src/integrations/composio/trigger_history_tests.rs+++ b/crates/openhuman-core/src/integrations/composio/trigger_history_tests.rs@@ -81,7 +81,7 @@ async fn connected_owner(fixture: Fixture) -> (Arc<TriggerHistory>, tinybus::Con.await.unwrap();service.request_name("test.ConnectorArchive").await.unwrap();- let client = ModuleClient::fixture(+ let client = crate::modules::ops::fixture_client(caller.proxy("test.ConnectorArchive",diff --git a/crates/openhuman-core/src/modules/accessibility.rs b/crates/openhuman-core/src/modules/accessibility.rsindex 01664669e6..1acc1ff286 100644--- a/crates/openhuman-core/src/modules/accessibility.rs+++ b/crates/openhuman-core/src/modules/accessibility.rs@@ -51,7 +51,7 @@ impl AccessibilityClient {#[cfg(all(test, feature = "modules"))]pub(crate) fn fixture(proxy: tinybus::Proxy) -> Self {Self {- client: ModuleClient::fixture(proxy),+ client: crate::modules::ops::fixture_client(proxy),computer_enabled: true,}}diff --git a/crates/openhuman-core/src/modules/accessibility_tests.rs b/crates/openhuman-core/src/modules/accessibility_tests.rsindex 41cfedf29e..fe5e658a09 100644--- a/crates/openhuman-core/src/modules/accessibility_tests.rs+++ b/crates/openhuman-core/src/modules/accessibility_tests.rs@@ -110,7 +110,7 @@ async fn fixture(.unwrap();(AccessibilityClient {- client: ModuleClient::fixture(proxy),+ client: crate::modules::ops::fixture_client(proxy),computer_enabled: true,},fixture,diff --git a/crates/openhuman-core/src/modules/channel_controller_tests.rs b/crates/openhuman-core/src/modules/channel_controller_tests.rsindex e782fa8daa..7aa808e9d2 100644--- a/crates/openhuman-core/src/modules/channel_controller_tests.rs+++ b/crates/openhuman-core/src/modules/channel_controller_tests.rs@@ -47,7 +47,7 @@ async fn discord_credentials_never_reach_an_unattested_bus() {).unwrap();let result = discord::<Vec<DiscordGuild>>(- &ModuleClient::fixture(proxy.clone()),+ &crate::modules::ops::fixture_client(proxy.clone()),ChannelControllerRequest::DiscordListGuilds {config: Default::default(),bot_token: "fixture-token".into(),@@ -58,7 +58,7 @@ async fn discord_credentials_never_reach_an_unattested_bus() {.await;assert_eq!(result.unwrap_err(), ModuleCallError::TransportFailed);let prepared = prepare_connection(- &ModuleClient::fixture(proxy),+ &crate::modules::ops::fixture_client(proxy),ChannelControllerRequest::PrepareConnect {config: Default::default(),channel: "discord".into(),diff --git a/crates/openhuman-core/src/modules/channel_health_tests.rs b/crates/openhuman-core/src/modules/channel_health_tests.rsindex e479e6a762..010ece0b42 100644--- a/crates/openhuman-core/src/modules/channel_health_tests.rs+++ b/crates/openhuman-core/src/modules/channel_health_tests.rs@@ -47,7 +47,7 @@ async fn provider_credentials_never_reach_an_unattested_bus() {).unwrap();let error = check(- &ModuleClient::fixture(proxy),+ &crate::modules::ops::fixture_client(proxy),ChannelsConfig::default(),HttpProxyPolicy::default(),)diff --git a/crates/openhuman-core/src/modules/client_tests.rs b/crates/openhuman-core/src/modules/client_tests.rsindex ae607ed4f6..ca4c5da1bf 100644--- a/crates/openhuman-core/src/modules/client_tests.rs+++ b/crates/openhuman-core/src/modules/client_tests.rs@@ -366,7 +366,7 @@ fn configured_client_timeout_overrides_the_default_for_fixture_calls() {.unwrap();(proxy, service)});- let client = ModuleClient::fixture(proxy).with_timeout(std::time::Duration::from_millis(5));+ let client = crate::modules::ops::fixture_client(proxy).with_timeout(std::time::Duration::from_millis(5));let result = runtime.block_on(client.call::<()>("tinysearch", "Delayed", ()));assert_eq!(result, Err(ModuleCallError::TransportFailed));}@@ -405,7 +405,7 @@ fn malformed_inner_json_from_a_real_bus_reply_is_reported_as_a_sanitized_fault().unwrap();(proxy, service)});- let client = ModuleClient::fixture(proxy);+ let client = crate::modules::ops::fixture_client(proxy);let events = sentry::test::with_captured_events(|| {assert_eq!(runtime.block_on(client.call_json::<serde_json::Value>(diff --git a/crates/openhuman-core/src/modules/ops.rs b/crates/openhuman-core/src/modules/ops.rsindex 3efb6bc8b1..d16336eaf3 100644--- a/crates/openhuman-core/src/modules/ops.rs+++ b/crates/openhuman-core/src/modules/ops.rs@@ -175,6 +175,14 @@ pub fn client(config: Config) -> ModuleClient {ModuleClient::new(resolver(&config))}+/// A client whose every call goes to `proxy` instead of loading a module. The+/// module must still be in the registry and modules must still be enabled.+#[cfg(test)]+#[must_use]+pub(crate) fn fixture_client(proxy: tinybus::Proxy) -> ModuleClient {+ client(Config::default()).with_fixture(proxy)+}+/// Log which source serves each module and warn about a local build whose/// gitlink is ahead of its released pin, once per id per process.fn log_plan_once(record: &ModuleRecord, plan: &source::SourcePlan) {diff --git a/crates/openhuman-core/src/modules/tinybox_tests.rs b/crates/openhuman-core/src/modules/tinybox_tests.rsindex 6e54c09735..3030bcb3c7 100644--- a/crates/openhuman-core/src/modules/tinybox_tests.rs+++ b/crates/openhuman-core/src/modules/tinybox_tests.rs@@ -131,7 +131,7 @@ async fn mock_client_with_docker_control_delay(contract::INTERFACE,).expect("TinyBox proxy");- (service, ModuleClient::fixture(proxy), calls)+ (service, crate::modules::ops::fixture_client(proxy), calls)}#[test]diff --git a/crates/openhuman-core/src/tools/impl/network/gitbooks_tests.rs b/crates/openhuman-core/src/tools/impl/network/gitbooks_tests.rsindex 253578e1a3..680bbd3649 100644--- a/crates/openhuman-core/src/tools/impl/network/gitbooks_tests.rs+++ b/crates/openhuman-core/src/tools/impl/network/gitbooks_tests.rs@@ -89,7 +89,7 @@ async fn mock_module_client(tinymcp_bus::names::INTERFACE,).expect("TinyMCP proxy");- (ModuleClient::fixture(proxy), service, provider_state)+ (crate::modules::ops::fixture_client(proxy), service, provider_state)}#[cfg(feature = "modules")]diff --git a/crates/openhuman-core/src/voice/capture_lease_tests.rs b/crates/openhuman-core/src/voice/capture_lease_tests.rsindex 4b99adb723..d0a37c292f 100644--- a/crates/openhuman-core/src/voice/capture_lease_tests.rs+++ b/crates/openhuman-core/src/voice/capture_lease_tests.rs@@ -192,7 +192,7 @@ async fn capture_never_retries_through_an_unattested_bus() {let lease = CaptureLease {state: Arc::new(State {id: 0,- port: Arc::new(BusPort(ModuleClient::fixture(proxy))),+ port: Arc::new(BusPort(crate::modules::ops::fixture_client(proxy))),handle: CaptureHandle("lease".into()),kind: Kind::Recording,closed: AtomicBool::new(false),