Skip to content

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

feat(session_host): ingest memory from runtime sessions

Steven Enamakelc20b7324797c
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 c3a1f12ad6..c23ff0f539 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session.rs
@@ -183,14 +183,6 @@ struct OpenHumanTurnPreludeMutable {
}
impl OpenHumanTurnPrelude {
- /// The context this session's turns run under, from the host environment
- /// bound at the start of the turn.
- fn dispatch_ctx(&self) -> crate::core::runtime::DispatchCtx {
- match &self.host_env.core {
- Some(core) => crate::core::runtime::DispatchCtx::new(Arc::clone(core)),
- None => crate::core::runtime::DispatchCtx::ambient(),
- }
- }
#[allow(clippy::type_complexity)]
fn current_tool_source(
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 6b1801640b..81ad734f25 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
@@ -71,6 +71,14 @@ pub(super) fn in_prompt_window(
}
impl OpenHumanTurnPrelude {
+ /// The context this session's turns run under, from the host environment
+ /// bound at the start of the turn.
+ pub(in crate::agent::session_host) fn dispatch_ctx(&self) -> crate::core::runtime::DispatchCtx {
+ match &self.host_env.core {
+ Some(core) => crate::core::runtime::DispatchCtx::new(Arc::clone(core)),
+ None => crate::core::runtime::DispatchCtx::ambient(),
+ }
+ }
/// The config memory runs under: the session's own, else the
/// workspace's on disk.
async fn memory_config(&self) -> Option<Arc<crate::config::Config>> {
diff --git a/crates/openhuman-core/src/web_chat/journal_shadow.rs b/crates/openhuman-core/src/web_chat/journal_shadow.rs
index 1cf02938f5..457333e4b9 100644
--- a/crates/openhuman-core/src/web_chat/journal_shadow.rs
+++ b/crates/openhuman-core/src/web_chat/journal_shadow.rs
@@ -100,7 +100,6 @@ fn describe_signature_divergence(live: &[String], projected: &[String]) -> Strin
}
pub(super) async fn shadow_compare_journal_projection(
- ctx: &crate::core::runtime::DispatchCtx,
request_id: &str,
trace_ctx: tinyagents_harness::observability::trace_export::TraceContext,
max_iterations: u32,
@@ -116,7 +115,7 @@ pub(super) async fn shadow_compare_journal_projection(
return None;
};
- let observations = match crate::agent::tinyagents::journal::read_run_events(ctx, &journal_run_id, 0)
+ let observations = match crate::agent::tinyagents::journal::read_run_events(&crate::core::runtime::DispatchCtx::ambient(), &journal_run_id, 0)
.await
{
Ok(observations) => observations,