Skip to content

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

chore: files changed crates/openhuman-core/src/agent/session_host/runtime_session/memory_ingest.rs,c

Steven Enamakelde2d3486f769
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session/memory_ingest.rs b/crates/openhuman-core/src/agent/session_host/runtime_session/memory_ingest.rs
index d963a02463..cd86457991 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session/memory_ingest.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session/memory_ingest.rs
@@ -160,13 +160,14 @@ impl OpenHumanTurnPrelude {
}
let user_index = hooks::user_turn_index(committed_turns);
let (in_prompt_from, compacted) = in_prompt_window(history, committed_turns, current);
+ let memory_channel = logged_channel(origin.as_ref());
self.mutable
.lock()
.unwrap_or_else(std::sync::PoisonError::into_inner)
.pending_memory_turn = Some(PendingMemoryTurn {
identity: identity.clone(),
user_index,
- channel: logged_channel(origin.as_ref()),
+ channel: memory_channel.clone(),
profile_context,
});
let pack = crate::memory::lifecycle::prefetch::pre_turn(
@@ -182,7 +183,7 @@ impl OpenHumanTurnPrelude {
origin
.as_ref()
.and_then(crate::memory::lifecycle::sender::channel_actor),
- Some(self.event_channel.clone()),
+ memory_channel,
);
Some(Arc::new(MemoryTurn {
config,
diff --git a/crates/openhuman-core/src/threads/store/backend.rs b/crates/openhuman-core/src/threads/store/backend.rs
index 065f6d3eba..a049dc6ca4 100644
--- a/crates/openhuman-core/src/threads/store/backend.rs
+++ b/crates/openhuman-core/src/threads/store/backend.rs
@@ -297,10 +297,22 @@ impl ConversationStore {
Ok(deleted)
}
- /// Removes every thread.
+ /// Removes every thread and records its conversation-memory deletion in
+ /// this workspace's existing best-effort queue as each header is removed.
+ /// Queue persistence keeps its existing IO and process-crash limitations.
pub fn purge_threads(&self) -> Result<ConversationPurgeStats, String> {
+ let workspace_dir = self.workspace_dir.clone();
let stats = self.run("purge_threads", NONE, |s| async move {
- s.purge_threads().await.map(ConversationPurgeStats::from)
+ s.purge_threads_with(move |thread_id| {
+ crate::memory::deletion::enqueue(
+ &workspace_dir,
+ crate::memory::deletion::PendingDeletion::Thread {
+ thread_id: thread_id.to_owned(),
+ },
+ );
+ })
+ .await
+ .map(ConversationPurgeStats::from)
})?;
self.forget_all_transcript_keys();
Ok(stats)