Skip to content

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

test(memory): update lifecycle hook calls to pre_turn_work

Steven Enamakel20c1063e8bb9
diff --git a/crates/openhuman-core/src/memory/backfill_tests.rs b/crates/openhuman-core/src/memory/backfill_tests.rs
index 3f35e825b6..af4f4f9a04 100644
--- a/crates/openhuman-core/src/memory/backfill_tests.rs
+++ b/crates/openhuman-core/src/memory/backfill_tests.rs
@@ -116,19 +116,17 @@ async fn stores_past_chats_once_and_skips_what_live_logging_took() {
.await;
// The lifecycle logged live-thread's second turn (user index 2).
let identity = MemoryIdentity::agent(MAIN_AGENT).resolve(&config);
- crate::memory::lifecycle::hooks::pre_turn(
+ crate::memory::lifecycle::hooks::pre_turn_work(
&crate::core::runtime::DispatchCtx::ambient(),
&config,
&identity,
- crate::memory::lifecycle::hooks::PreTurnInput {
- thread_id: "live-thread".into(),
- turn_index: 2,
- user_text: "After logging".into(),
- in_prompt_from: 0,
- at: Utc::now(),
- resumed_after_compaction: false,
- observed_actor: None,
- },
+ "live-thread".into(),
+ 2,
+ "After logging".into(),
+ 0,
+ Utc::now(),
+ false,
+ None,
)
.await;
diff --git a/crates/openhuman-core/src/memory/lifecycle/views_tests.rs b/crates/openhuman-core/src/memory/lifecycle/views_tests.rs
index c4d9c8a1be..aff0a1b7e6 100644
--- a/crates/openhuman-core/src/memory/lifecycle/views_tests.rs
+++ b/crates/openhuman-core/src/memory/lifecycle/views_tests.rs
@@ -3,7 +3,7 @@ use super::*;
use chrono::Utc;
use tinymemory_api::{LearningKind, MemoryEngine, MemoryMeta, StoreItem};
-use crate::memory::lifecycle::hooks::{self, PreTurnInput};
+use crate::memory::lifecycle::hooks::pre_turn_work;
use crate::memory::scope::MemoryIdentity;
use crate::memory::test_fixtures::{bind_reference, config_in};
@@ -122,19 +122,17 @@ async fn the_preview_reads_without_logging_and_agents_are_listed() {
.await
.unwrap();
let writer = scope::MemoryIdentity::agent("writer").resolve(&config);
- hooks::pre_turn(
+ pre_turn_work(
&crate::core::runtime::DispatchCtx::ambient(),
&config,
&writer,
- PreTurnInput {
- thread_id: "t".into(),
- turn_index: 0,
- user_text: "draft the invoice email".into(),
- in_prompt_from: 0,
- at: Utc::now(),
- resumed_after_compaction: false,
- observed_actor: None,
- },
+ "t".into(),
+ 0,
+ "draft the invoice email".into(),
+ 0,
+ Utc::now(),
+ false,
+ None,
)
.await;