The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(memory): bind the test driver once, not once per caller\n\n`shared_memory_test_workspace` called `install_memory_driver_for_test` on every\ninvocation, and its own comment claimed that was a no-op after the first:\n"`install_for_test` is idempotent for a given (workspace, config) key". It is\nnot. `install_for_test` ends in `BINDINGS.write().insert(key, binding)` — it\n*replaces* what is cached — and the driver it installs holds its rows in\nitself. So every caller after the first swapped in a brand-new empty store.\n\nMost of these tests do not hold `GLOBAL_MEMORY_TEST_LOCK`, so one test's setup\nran while another was between its write and its read, and wiped the rows that\ntest was about to look for. Sixteen handler tests failed as "the write is not\nvisible" — which reads like a driver that discards writes and was really a\nfixture that discards stores.\n\nThe engine version this replaced did not have the problem for a reason worth\nnaming: it went through `tinymemory_core::global::init`, which was genuinely\nonce-only. Handing back only the directory dropped that guarantee along with\nthe engine, and the replacement re-established the wrong half.\n\nBinding now happens inside `get_or_init`, so it happens exactly once for the\nprocess no matter how many tests ask for the workspace.\n
Shanuee009738abe4
diff --git a/src/openhuman/memory/ops/test_support/mod.rs b/src/openhuman/memory/ops/test_support/mod.rsindex bb1a50818f..91e30171e9 100644--- a/src/openhuman/memory/ops/test_support/mod.rs+++ b/src/openhuman/memory/ops/test_support/mod.rs@@ -31,6 +31,31 @@ pub(crate) fn shared_memory_test_workspace() -> PathBuf {let path = tmp.path().join("workspace");std::fs::create_dir_all(&path).expect("workspace dir");std::mem::forget(tmp);++ // Bind a driver over it, which is the half callers actually depend+ // on, and bind it exactly once.+ //+ // This helper replaced `ensure_shared_memory_client`, which booted+ // the in-process engine and bound *that*. Handing back only the+ // directory was the wrong half of the trade: `memory::ops`+ // handlers resolve through the bound driver, so with nothing bound+ // they fall through to the module path and fail with "the memory+ // module failed to load" — an error about a missing artifact, in a+ // unit test that never wanted one.+ //+ // Binding must happen **inside** `get_or_init`. `install_for_test`+ // *replaces* the cached binding rather than leaving an existing one+ // alone (`BINDINGS.write().insert(key, ..)`), and the driver it+ // installs stores rows in itself. Calling it per caller therefore+ // hands every test a brand-new empty store, and — because most of+ // these tests do not hold `GLOBAL_MEMORY_TEST_LOCK` — a second+ // test's setup wipes the rows a first test has already written and+ // is about to read back. That failed 16 handler tests as+ // "the write is not visible", which reads like a driver that+ // discards writes and is really a fixture that discards stores.+ let mut config = crate::openhuman::config::Config::default();+ config.workspace_dir = path.clone();+ crate::openhuman::memory::test_support::install_memory_driver_for_test(&config);path}).clone()