Skip to content

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

test(memory): pass dispatch context to citation helpers

Steven Enamakel5693c9f03e54
diff --git a/crates/openhuman-core/src/memory/tools_agent_tests.rs b/crates/openhuman-core/src/memory/tools_agent_tests.rs
index bf1f097600..5ca616a19a 100644
--- a/crates/openhuman-core/src/memory/tools_agent_tests.rs
+++ b/crates/openhuman-core/src/memory/tools_agent_tests.rs
@@ -32,16 +32,16 @@ async fn turn_citations_stay_with_the_agent_that_recorded_them() {
let thread = "shared-thread";
CoreContext::scope(Arc::clone(&alpha), async {
- record_pack_citations(thread, vec![citation("alpha-cite")]);
+ record_pack_citations(&crate::core::runtime::DispatchCtx::ambient(), thread, vec![citation("alpha-cite")]);
})
.await;
CoreContext::scope(Arc::clone(&beta), async {
- record_pack_citations(thread, vec![citation("beta-cite")]);
+ record_pack_citations(&crate::core::runtime::DispatchCtx::ambient(), thread, vec![citation("beta-cite")]);
})
.await;
- let from_beta = CoreContext::scope(beta, async { take_turn_citations(thread) }).await;
- let from_alpha = CoreContext::scope(alpha, async { take_turn_citations(thread) }).await;
+ let from_beta = CoreContext::scope(beta, async { take_turn_citations(&crate::core::runtime::DispatchCtx::ambient(), thread) }).await;
+ let from_alpha = CoreContext::scope(alpha, async { take_turn_citations(&crate::core::runtime::DispatchCtx::ambient(), thread) }).await;
assert_eq!(
from_alpha.iter().map(|c| c.id.as_str()).collect::<Vec<_>>(),
diff --git a/crates/openhuman-core/src/memory/tools_tests.rs b/crates/openhuman-core/src/memory/tools_tests.rs
index 523f1d3e04..f0d7dec371 100644
--- a/crates/openhuman-core/src/memory/tools_tests.rs
+++ b/crates/openhuman-core/src/memory/tools_tests.rs
@@ -274,9 +274,9 @@ fn turn_citations_are_capped_and_deduplicated() {
};
let thread = "thread-cap";
let many: Vec<_> = (0..MAX_TURN_CITATIONS + 10).map(citation).collect();
- record_turn_citations(thread, &many);
- record_turn_citations(thread, &many[..2]);
- record_turn_citations(thread, &[]);
+ record_turn_citations(&crate::core::runtime::DispatchCtx::ambient(), thread, &many);
+ record_turn_citations(&crate::core::runtime::DispatchCtx::ambient(), thread, &many[..2]);
+ record_turn_citations(&crate::core::runtime::DispatchCtx::ambient(), thread, &[]);
let drained = take_turn_citations(&crate::core::runtime::DispatchCtx::ambient(), thread);
assert_eq!(drained.len(), MAX_TURN_CITATIONS);
assert_eq!(