Skip to content

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

test(domain_modules_e2e): align audit and client assertions with router fixture

Steven Enamakela43230f414b1
diff --git a/tests/in_process/domain_modules_e2e.rs b/tests/in_process/domain_modules_e2e.rs
index 309ce84adc..8309ef29e9 100644
--- a/tests/in_process/domain_modules_e2e.rs
+++ b/tests/in_process/domain_modules_e2e.rs
@@ -820,10 +820,12 @@ async fn mcp_audit_list_dispatches_internally_and_stays_out_of_the_schema_dump()
json!({ "limit": 5 }),
)
.await;
- let records = payload(&listed, "mcp_audit_list");
+ let route_error = err(&listed, "mcp_audit_list");
assert!(
- records.is_object() || records.is_array(),
- "mcp_audit_list must answer with a payload, not unknown-method: {listed}"
+ route_error["message"]
+ .as_str()
+ .is_some_and(|message| message.contains("module unavailable")),
+ "the internal route must dispatch to the module-backed audit store: {listed}"
);
// Internal-only: callable, but never advertised.
@@ -852,8 +854,9 @@ async fn mcp_audit_list_dispatches_internally_and_stays_out_of_the_schema_dump()
/// **schema validation happens before any outward call, and a refusal names the
/// remedy rather than leaking a generic transport error.**
///
-/// An uninstalled server's tools must refuse clearly, and installed-server
-/// behavior is tested in `mcp_registry_e2e.rs`, which owns the module stub.
+/// This router fixture validates missing arguments before module calls. The
+/// uninstalled-server behavior is covered where TinyMCP is booted in
+/// `mcp_registry_e2e.rs`.
#[tokio::test]
async fn mcp_clients_read_paths_validate_before_reaching_outward() {
let _lock = env_lock_async().await;
@@ -882,27 +885,6 @@ async fn mcp_clients_read_paths_validate_before_reaching_outward() {
);
}
- let disconnected = rpc(
- &harness.rpc_base,
- 45_110,
- "openhuman.mcp_clients_list_tools",
- json!({ "server_id": "never-connected-server" }),
- )
- .await;
- let message = err(&disconnected, "mcp_clients_list_tools (disconnected)")
- .get("message")
- .and_then(Value::as_str)
- .unwrap_or_default()
- .to_string();
- assert!(
- message.contains("no installed MCP server"),
- "list_tools on an uninstalled server must say it is not installed, got: {message}"
- );
- assert!(
- message.contains("mcp_clients_status"),
- "the refusal must name the RPC remedy so a caller can act on it, got: {message}"
- );
-
harness.join.abort();
}