Skip to content

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

test(mcp): align test doubles with updated port contracts

Steven Enamakelb6ec5147581d
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs b/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs
index 5adde6a4fd..2b3d332070 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs
@@ -304,7 +304,10 @@ async fn resumed_mcp_snapshot_survives_a_cold_catalog_and_keeps_its_frozen_spec(
.iter()
.find(|spec| spec.name == name)
.expect("recorded MCP name survives the cold catalog");
- assert_eq!(cold_spec, &recorded_spec);
+ assert_eq!(
+ serde_json::to_value(cold_spec).expect("serialize restored declaration"),
+ serde_json::to_value(&recorded_spec).expect("serialize frozen declaration")
+ );
prelude
.mutable
@@ -336,7 +339,10 @@ async fn resumed_mcp_snapshot_survives_a_cold_catalog_and_keeps_its_frozen_spec(
.iter()
.find(|spec| spec.name == name)
.expect("recorded MCP name remains present");
- assert_eq!(recovered_spec, &recorded_spec);
+ assert_eq!(
+ serde_json::to_value(recovered_spec).expect("serialize restored declaration"),
+ serde_json::to_value(&recorded_spec).expect("serialize frozen declaration")
+ );
}
#[cfg(feature = "modules")]
diff --git a/crates/openhuman-core/src/mcp/module_client_tests.rs b/crates/openhuman-core/src/mcp/module_client_tests.rs
index ba8436f7d6..afdd247bc3 100644
--- a/crates/openhuman-core/src/mcp/module_client_tests.rs
+++ b/crates/openhuman-core/src/mcp/module_client_tests.rs
@@ -82,7 +82,7 @@ impl McpModulePort for FakePort {
self.calls.lock().unwrap().push((
object_path.to_owned(),
member.to_owned(),
- args,
+ args: args.clone(),
confidential,
));
self.call_started.notify_one();
diff --git a/crates/openhuman-core/src/mcp/registry/tools_tests.rs b/crates/openhuman-core/src/mcp/registry/tools_tests.rs
index 7e3c797e88..5c608077ea 100644
--- a/crates/openhuman-core/src/mcp/registry/tools_tests.rs
+++ b/crates/openhuman-core/src/mcp/registry/tools_tests.rs
@@ -327,6 +327,13 @@ impl crate::mcp::module_client::McpModulePort for ToolCallPort {
}
}
+ async fn validate_server_arguments(
+ &self,
+ _request: tinymcp_bus::ValidateServerArgumentsRequest,
+ ) -> Result<tinymcp_bus::ServerArgumentsValidation, crate::modules::client::ModuleCallError> {
+ Err(crate::modules::client::ModuleCallError::IncompatibleContract)
+ }
+
async fn prepare_agent_tools(
&self,
_request: tinymcp_bus::PrepareAgentToolsRequest,