Skip to content

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

test(memory): add coverage for brain, confine, lifecycle and tool writes

Steven Enamakel46f8f357a443
diff --git a/crates/openhuman-core/src/agent/harness/graph_tests.rs b/crates/openhuman-core/src/agent/harness/graph_tests.rs
index eac0ce2444..b59de259d1 100644
--- a/crates/openhuman-core/src/agent/harness/graph_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/graph_tests.rs
@@ -65,6 +65,7 @@ async fn channel_turn_runs_through_the_graph() {
None,
tinyagents_definition::SandboxMode::None,
Default::default(),
+ Default::default(),
)
.await
.expect("channel graph turn runs");
@@ -128,6 +129,7 @@ async fn channel_turn_pauses_on_ask_user_clarification() {
None,
tinyagents_definition::SandboxMode::None,
Default::default(),
+ Default::default(),
)
.await
.expect("channel graph turn runs");
diff --git a/crates/openhuman-core/src/memory/brain_tests.rs b/crates/openhuman-core/src/memory/brain_tests.rs
index 14ec1f456f..eb8229ae45 100644
--- a/crates/openhuman-core/src/memory/brain_tests.rs
+++ b/crates/openhuman-core/src/memory/brain_tests.rs
@@ -1,6 +1,6 @@
use super::*;
-
+use crate::memory::scope::MemoryIdentity;
use tinymemory_tools::layout::placement::file_into;
use tinymemory_api::{ItemKind, MemoryMeta, MetaFilter};
diff --git a/crates/openhuman-core/src/memory/confine_tests.rs b/crates/openhuman-core/src/memory/confine_tests.rs
index a026367cb1..e08ec9fd81 100644
--- a/crates/openhuman-core/src/memory/confine_tests.rs
+++ b/crates/openhuman-core/src/memory/confine_tests.rs
@@ -297,6 +297,7 @@ async fn items_get_and_forget_leave_another_roots_items_alone() {
other.memory.root = Some("team:other".to_string());
let still = items_get(
&other,
+ &MemoryIdentity::root(),
ItemsGetParams {
ids: vec![theirs.clone()],
reach: None,
diff --git a/crates/openhuman-core/src/memory/lifecycle/views_tests.rs b/crates/openhuman-core/src/memory/lifecycle/views_tests.rs
index 9c1f3e54d2..e64ffa4291 100644
--- a/crates/openhuman-core/src/memory/lifecycle/views_tests.rs
+++ b/crates/openhuman-core/src/memory/lifecycle/views_tests.rs
@@ -89,6 +89,7 @@ async fn the_preview_reads_without_logging_and_agents_are_listed() {
let turn = pack_preview(
&config,
+ &MemoryIdentity::root(),
PackPreviewParams {
query: Some("when do invoices go out?".into()),
agent_id: Some("writer".into()),
@@ -101,12 +102,12 @@ async fn the_preview_reads_without_logging_and_agents_are_listed() {
assert_eq!(turn.agent_id, "writer");
assert!(turn.pack.markdown.contains("1st"));
- let session = pack_preview(&config, PackPreviewParams::default())
+ let session = pack_preview(&config,&MemoryIdentity::root(), PackPreviewParams::default())
.await
.unwrap();
assert_eq!(session.mode, "session");
- let agents = agents_list(&config).await.unwrap();
+ let agents = agents_list(&config, &MemoryIdentity::root()).await.unwrap();
assert_eq!(
agents.agents,
[AgentCount {
diff --git a/crates/openhuman-core/src/memory/tool_writes_tests.rs b/crates/openhuman-core/src/memory/tool_writes_tests.rs
index 3a25ea0a82..3818786613 100644
--- a/crates/openhuman-core/src/memory/tool_writes_tests.rs
+++ b/crates/openhuman-core/src/memory/tool_writes_tests.rs
@@ -424,7 +424,7 @@ async fn an_erase_fence_waits_for_only_the_current_write_and_preserves_later_enq
&facts(&config),
)
.unwrap();
- schedule(Arc::new(config.clone()));
+ schedule(Arc::new(config.clone()), &Namespace::ROOT);
engine.entered.notified().await;
let fence_config = config.clone();
let fencing = tokio::spawn(async move { fence_and_clear(&fence_config).await });
@@ -458,7 +458,7 @@ async fn an_erase_fence_waits_for_only_the_current_write_and_preserves_later_enq
&facts(&config),
)
.unwrap();
- schedule(Arc::new(config.clone()));
+ schedule(Arc::new(config.clone()), &Namespace::ROOT);
assert_eq!(read(&config.workspace_dir).unwrap().len(), 2);
drop(fence);
drain(&config).await;
diff --git a/crates/openhuman-core/src/skills/e2e_plumbing_tests.rs b/crates/openhuman-core/src/skills/e2e_plumbing_tests.rs
index c7890a1406..d5136b213a 100644
--- a/crates/openhuman-core/src/skills/e2e_plumbing_tests.rs
+++ b/crates/openhuman-core/src/skills/e2e_plumbing_tests.rs
@@ -211,6 +211,7 @@ async fn mock_llm_orchestrator_lists_and_runs_workflows_through_the_loop() {
None,
tinyagents_definition::SandboxMode::None,
Default::default(),
+ Default::default(),
)
.await
.expect("tool loop should run to completion");