Skip to content

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

refactor(tests): remove memory module seam and settle from memory RPC helpers

Steven Enamakelf19fe7af2ed0
diff --git a/tests/support/memory_rpc.rs b/tests/support/memory_rpc.rs
index be33ac0598..574a705fa1 100644
--- a/tests/support/memory_rpc.rs
+++ b/tests/support/memory_rpc.rs
@@ -1,43 +1,23 @@
//! Boilerplate shared by the memory RPC suites that serve the core router
//! in-process (`memory_sources_e2e`, `memory_tree_health_e2e`,
-//! `tree_summarizer_e2e`): the memory-module policy seam, a minimal workspace
-//! config, a served router with the memory module settled, and the
+//! `tree_summarizer_e2e`): a minimal workspace config, a served router, and the
//! `Outcome`-unwrapping `ok`.
//!
-//! Declare it at the root of an aggregated target next to `rpc_auth` and
-//! `memory_module`.
+//! Declare it at the root of an aggregated target next to `rpc_auth`.
#![allow(dead_code)]
use std::path::Path;
-use std::sync::{Arc, OnceLock};
-
use openhuman_rpc::server::build_core_http_router;
use serde_json::Value;
-use crate::memory_module;
use crate::rpc_auth::ensure_rpc_auth;
-static MEMORY_SEAMS_INIT: OnceLock<()> = OnceLock::new();
-
/// Install the memory module's policy once per process, on a thread with a
/// stack deep enough for the policy build (a default test stack overflows).
pub fn ensure_memory_seams() {
- MEMORY_SEAMS_INIT.get_or_init(|| {
- std::thread::Builder::new()
- .name("memory-e2e-seams".to_string())
- .stack_size(8 * 1024 * 1024)
- .spawn(|| {
- let config = Arc::new(openhuman_core::config::Config::default());
- #[cfg(feature = "modules")]
- openhuman_core::modules::memory::set_modules_policy(config);
- #[cfg(not(feature = "modules"))]
- drop(config);
- })
- .expect("spawn memory seam installer")
- .join()
- .expect("memory seam installer panicked");
- });
+ // Kept as a no-op for call-site compatibility; memory is hosted directly
+ // by the core and no longer requires a loadable memory module.
}
/// Write the minimal workspace config (plus the `users/local` copy) under `dir`.
@@ -60,14 +40,10 @@ embedding_strict = false
std::fs::write(user_dir.join("config.toml"), cfg).expect("write user config");
}
-/// Serve the core router with the memory module loaded; returns the base URL.
-///
-/// Every flow reaches the memory module, so wait out its load: a test running
-/// in its own process would otherwise race it (see `memory_module`).
+/// Serve the core router; returns the base URL.
pub async fn serve() -> (String, tokio::task::JoinHandle<Result<(), std::io::Error>>) {
ensure_memory_seams();
ensure_rpc_auth();
- memory_module::settle().await;
let listener = tokio::net::TcpListener::bind("127.0.0.1:0")
.await
.expect("bind");