Skip to content

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

refactor(session_host): expose memory_block module to parent scope

Steven Enamakel8ad153812bb0
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session.rs b/crates/openhuman-core/src/agent/session_host/runtime_session.rs
index 0d80b6f4c8..1c69ba0107 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session.rs
@@ -4,8 +4,7 @@
//! transcripts, prefixes, snapshots, resume, and persistence.
mod bound_history;
-mod memory_block;
-pub(crate) use memory_block::with_memory_block;
+pub(super) mod memory_block;
#[path = "runtime_session_enrichment.rs"]
mod enrichment;
mod permanent;
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session/memory_block.rs b/crates/openhuman-core/src/agent/session_host/runtime_session/memory_block.rs
index 104802b9a7..b161a02154 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session/memory_block.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session/memory_block.rs
@@ -240,6 +240,13 @@ impl OpenHumanSessionHost {
/// session opens outside a turn (an out-of-band compaction): put it into
/// the successor's prefix with [`with_memory_block`]. `None` when the
/// agent has no memory block, nothing is known, or memory cannot be read.
+ #[cfg_attr(
+ not(test),
+ expect(
+ dead_code,
+ reason = "the seam for an out-of-band compaction, whose caller lands separately"
+ )
+ )]
pub(crate) async fn memory_block_for_new_generation(&self) -> Option<Message> {
let prelude = self.create_turn_prelude(false);
let max_tokens = prelude.memory_block_budget()?;