Skip to content

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

chore(mcp): re-enable skipped mcp tests and apply rustfmt

Steven Enamakelcb5859c54379
diff --git a/.github/workflows/test-reusable.yml b/.github/workflows/test-reusable.yml
index bba7a2f363..d5c51f5648 100644
--- a/.github/workflows/test-reusable.yml
+++ b/.github/workflows/test-reusable.yml
@@ -257,13 +257,6 @@ jobs:
cron::documents_port::tests::a_collection_outside_the_schedule_port_is_refused
cron::documents_port::tests::an_unknown_operation_is_refused_not_guessed
cron::documents_port::tests::one_object_is_served_per_scope_and_reused
- mcp::audit::schemas::tests::handle_list_returns_persisted_audit_records
- mcp::server::tools::tests::dispatch_tests::call_tool_judges_the_policy_of_the_explicit_context_across_scopes
- mcp::server::tools::tests::dispatch_tests::call_tool_records_write_argument_rejection
- mcp::server::tools::tests::dispatch_tests::call_tool_validates_memory_arguments_before_dispatch
- mcp::server::write_dispatch::tests::audit_write_rejection_records_failure_row
- mcp::server::write_dispatch::tests::test_audit_write_success_path
- mcp::server::write_dispatch::tests::test_dispatch_write_tool_rpc_error_records_audit_and_returns_tool_error
)
MODULE_TEST_SKIP_ARGS=()
for module_test in "${MODULE_TESTS[@]}"; do
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 16d5eb7d0f..abdd918d84 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
@@ -18,14 +18,9 @@ async fn call_tool_records_write_argument_rejection() {
),
);
- let err = call_tool(
- &ctx,
- "memory.learn",
- json!({ "kind": "fact" }),
- "mcp:test",
- )
- .await
- .expect_err("missing text should reject");
+ let err = call_tool(&ctx, "memory.learn", json!({ "kind": "fact" }), "mcp:test")
+ .await
+ .expect_err("missing text should reject");
assert!(
err.message().contains("missing required argument `text`"),
"got: {}",
@@ -98,14 +93,9 @@ async fn call_tool_validates_memory_arguments_before_dispatch() {
config.clone(),
),
);
- let err = call_tool(
- &ctx,
- "memory.forget",
- json!({ "ids": [] }),
- "mcp:test",
- )
- .await
- .expect_err("empty ids rejected before any RPC");
+ let err = call_tool(&ctx, "memory.forget", json!({ "ids": [] }), "mcp:test")
+ .await
+ .expect_err("empty ids rejected before any RPC");
assert!(err.message().contains("`ids`"), "got: {}", err.message());
let err = call_tool(
&ctx,
@@ -122,7 +112,6 @@ async fn call_tool_validates_memory_arguments_before_dispatch() {
}
/// The policy a tool call is judged by comes from the context handed to
-/// `call_tool`, not from whichever context the task happens to be scoped to,
/// and two sessions running side by side never see each other's.
#[tokio::test]
async fn call_tool_judges_the_policy_of_the_explicit_context_across_scopes() {
diff --git a/crates/openhuman-core/src/mcp/test_module_port.rs b/crates/openhuman-core/src/mcp/test_module_port.rs
index ce4ab14723..8b4262e21d 100644
--- a/crates/openhuman-core/src/mcp/test_module_port.rs
+++ b/crates/openhuman-core/src/mcp/test_module_port.rs
@@ -108,22 +108,24 @@ impl McpModulePort for Port {
}
}
ServerArgumentRule::RequiredNonEmptyStringArray { key } => {
- let valid = args.get(&key).and_then(Value::as_array).is_some_and(|values| {
- !values.is_empty()
- && values.iter().all(|value| {
- value.as_str().is_some_and(|text| !text.trim().is_empty())
- })
- });
+ let valid = args
+ .get(&key)
+ .and_then(Value::as_array)
+ .is_some_and(|values| {
+ !values.is_empty()
+ && values.iter().all(|value| {
+ value.as_str().is_some_and(|text| !text.trim().is_empty())
+ })
+ });
if !valid {
- return Ok(invalid(&format!("`{key}` must be a non-empty string array")));
+ return Ok(invalid(&format!(
+ "`{key}` must be a non-empty string array"
+ )));
}
}
ServerArgumentRule::OptionalNonEmptyString { key } => {
if args.get(&key).is_some_and(|value| {
- !value.is_null()
- && value
- .as_str()
- .is_none_or(|text| text.trim().is_empty())
+ !value.is_null() && value.as_str().is_none_or(|text| text.trim().is_empty())
}) {
return Ok(invalid(&format!("`{key}` must be a non-empty string")));
}