Skip to content

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

refactor(modules): return unit from import_legacy_mcp

Steven Enamakel38bd6018a072
diff --git a/crates/openhuman-core/src/mcp/module_client.rs b/crates/openhuman-core/src/mcp/module_client.rs
index 5a8b9931ff..0ed89824d0 100644
--- a/crates/openhuman-core/src/mcp/module_client.rs
+++ b/crates/openhuman-core/src/mcp/module_client.rs
@@ -375,7 +375,7 @@ impl McpConfiguredClient {
// Servers and audit rows from before the storage contract
// move into the module's storage before it reads them.
// Best effort: a failure is retried at the next open.
- let _ = crate::modules::import_legacy_mcp(
+ crate::modules::import_legacy_mcp(
&crate::core::runtime::DispatchCtx::ambient(),
std::path::Path::new(&self.data_dir),
)
diff --git a/crates/openhuman-core/src/modules/mod.rs b/crates/openhuman-core/src/modules/mod.rs
index 8a1981e5b6..a730785fb3 100644
--- a/crates/openhuman-core/src/modules/mod.rs
+++ b/crates/openhuman-core/src/modules/mod.rs
@@ -173,16 +173,18 @@ pub use types::{LoadPolicy, ModuleRecord, ModuleSource, ModuleState, ModuleStatu
pub async fn import_legacy_mcp(
ctx: &crate::core::runtime::DispatchCtx,
data_dir: &std::path::Path,
-) -> Result<String, String> {
+) -> Result<(), String> {
#[cfg(all(feature = "modules", feature = "legacy-import"))]
{
match storage_import_tinymcp::import_legacy(ctx, data_dir).await {
Ok(outcome) => {
- let summary = format!("{outcome:?}");
- log::debug!("[mcp] legacy storage import: {outcome:?}");
- storage_grant_schemas::migrate_imported(ctx, storage_grant_schemas::tinymcp::MODULE_ID)
+ log::debug!("[mcp] legacy storage import: {outcome:?}");
+ storage_grant_schemas::migrate_imported(
+ ctx,
+ storage_grant_schemas::tinymcp::MODULE_ID,
+ )
.await;
- Ok(summary)
+ Ok(())
}
Err(error) => {
log::warn!("[mcp] legacy storage import failed, will retry: {error:#}");
@@ -200,7 +202,7 @@ pub async fn import_legacy_mcp(
#[cfg(not(feature = "modules"))]
{
let _ = (ctx, data_dir);
- Ok("Unavailable".to_owned())
+ Ok(())
}
}
diff --git a/tests/storage_desktop_upgrade_e2e.rs b/tests/storage_desktop_upgrade_e2e.rs
index 8e3314ec2a..23dc23444a 100644
--- a/tests/storage_desktop_upgrade_e2e.rs
+++ b/tests/storage_desktop_upgrade_e2e.rs
@@ -416,14 +416,9 @@ async fn host_documents(backend: &dyn StorageBackend) -> usize {
async fn import_modules(workspace: &Path) {
use openhuman_core::modules;
let ctx = openhuman_core::core::runtime::DispatchCtx::process_default();
- let mcp_import = modules::import_legacy_mcp(&ctx, workspace)
+ modules::import_legacy_mcp(&ctx, workspace)
.await
.expect("import the legacy TinyMCP records");
- assert_eq!(
- mcp_import,
- "Imported { servers: 2, secrets: 1, audit: 2 }",
- "TinyMCP import should consume both legacy stores"
- );
modules::import_legacy_connectors(&ctx, workspace).await;
#[cfg(feature = "web3")]
assert!(modules::import_legacy_x402(&ctx, workspace).await);