Skip to content

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

test(goals): update goal store test to use tokio

Steven Enamakel2a87ca9bf879
diff --git a/crates/openhuman-core/src/agent/goals/mod_tests.rs b/crates/openhuman-core/src/agent/goals/mod_tests.rs
index 2114608918..99537e0ffa 100644
--- a/crates/openhuman-core/src/agent/goals/mod_tests.rs
+++ b/crates/openhuman-core/src/agent/goals/mod_tests.rs
@@ -1,17 +1,19 @@
use super::*;
-#[test]
-fn goal_store_is_reused_within_a_context_and_isolated_between_contexts() {
+#[tokio::test]
+async fn goal_store_is_reused_within_a_context_and_isolated_between_agents() {
let first_workspace = tempfile::tempdir().expect("first workspace");
let second_workspace = tempfile::tempdir().expect("second workspace");
let first_context = crate::core::runtime::CoreContext::for_test(
crate::core::runtime::DomainSet::full(),
Some(first_workspace.path().to_path_buf()),
- );
+ )
+ .for_agent("agent-a");
let second_context = crate::core::runtime::CoreContext::for_test(
crate::core::runtime::DomainSet::full(),
Some(first_workspace.path().to_path_buf()),
- );
+ )
+ .for_agent("agent-b");
let first_dispatch = crate::core::runtime::DispatchCtx::new(first_context);
let second_dispatch = crate::core::runtime::DispatchCtx::new(second_context);
@@ -23,4 +25,14 @@ fn goal_store_is_reused_within_a_context_and_isolated_between_contexts() {
assert!(Arc::ptr_eq(&first, &repeated));
assert!(!Arc::ptr_eq(&first, &isolated));
assert!(!Arc::ptr_eq(&first, &other_workspace));
+
+ first
+ .set("same-thread", "agent a objective", None)
+ .await
+ .expect("write first agent goal");
+ assert!(isolated
+ .get("same-thread")
+ .await
+ .expect("read second agent goal")
+ .is_none());
}