Skip to content

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

fix(memory): use persistent storage backend in workspace state tests

Steven Enamakelea253d172d1a
diff --git a/crates/openhuman-core/src/memory/state_store.rs b/crates/openhuman-core/src/memory/state_store.rs
index a01ac1e2b5..830bd9be2e 100644
--- a/crates/openhuman-core/src/memory/state_store.rs
+++ b/crates/openhuman-core/src/memory/state_store.rs
@@ -106,6 +106,13 @@ fn open_workspace_quarantining<T: DeserializeOwned>(
workspace_dir: &Path,
name: &str,
) -> Result<StateKv> {
+ // Workspace state uses conditional writes for safe legacy import and
+ // updates. The ordinary unit-test backend is in-memory and does not
+ // implement that capability, so use the durable workspace default just
+ // as `StateKv::open` does for the acting scope.
+ #[cfg(all(test, feature = "storage-sqlite"))]
+ crate::storage::local::use_persistent_default_for_test(workspace_dir);
+
let scope = workspace_scope(workspace_dir)?;
let backend = crate::storage::local::backend_for(workspace_dir)?;
open_workspace_quarantining_on::<T>(workspace_dir, &backend, &scope, name)