Skip to content

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

test(mcp): load declared modules in dispatch and audit tests

Steven Enamakel515e3bf78f59
diff --git a/crates/openhuman-core/src/mcp/audit/schemas_tests.rs b/crates/openhuman-core/src/mcp/audit/schemas_tests.rs
index 09d11923c6..358823b303 100644
--- a/crates/openhuman-core/src/mcp/audit/schemas_tests.rs
+++ b/crates/openhuman-core/src/mcp/audit/schemas_tests.rs
@@ -34,6 +34,7 @@ async fn handle_list_returns_persisted_audit_records() {
let config = config_rpc::load_config_with_timeout()
.await
.expect("config");
+ crate::modules::boot::load_declared_modules(&config).await;
crate::mcp::audit::record_write(
&config,
crate::mcp::audit::NewMcpWriteRecord {
diff --git a/crates/openhuman-core/src/mcp/server/tools_tests_dispatch_tests.rs b/crates/openhuman-core/src/mcp/server/tools_tests_dispatch_tests.rs
index 981ede1b1a..2df348d2f7 100644
--- a/crates/openhuman-core/src/mcp/server/tools_tests_dispatch_tests.rs
+++ b/crates/openhuman-core/src/mcp/server/tools_tests_dispatch_tests.rs
@@ -10,6 +10,7 @@ async fn call_tool_records_write_argument_rejection() {
let config = config_rpc::load_config_with_timeout()
.await
.expect("config");
+ crate::modules::boot::load_declared_modules(&config).await;
let err = call_tool(
&crate::core::runtime::DispatchCtx::ambient(),
@@ -81,6 +82,10 @@ async fn call_tool_validates_memory_arguments_before_dispatch() {
unsafe {
std::env::set_var("OPENHUMAN_WORKSPACE", tmp.path());
}
+ let config = config_rpc::load_config_with_timeout()
+ .await
+ .expect("config");
+ crate::modules::boot::load_declared_modules(&config).await;
let err = call_tool(
&crate::core::runtime::DispatchCtx::ambient(),
"memory.forget",
@@ -125,6 +130,7 @@ async fn call_tool_judges_the_policy_of_the_explicit_context_across_scopes() {
allowing.action_dir = tmp_allow.path().to_path_buf();
let deny_core = CoreContext::for_test_with_config(DomainSet::full(), denying);
let allow_core = CoreContext::for_test_with_config(DomainSet::full(), allowing);
+ crate::modules::boot::load_declared_modules(allow_core.config()).await;
let args = json!({ "agent_id": "no-such-agent", "prompt": "hello" });
// Each call runs scoped to the *other* context, so an ambient read would