Skip to content

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

feat(agent): add runtime session turn support

Steven Enamakel3c21717de324
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session_turn.rs b/crates/openhuman-core/src/agent/session_host/runtime_session_turn.rs
index b336676b4d..ab37b2fe7b 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session_turn.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session_turn.rs
@@ -44,6 +44,9 @@ impl OpenHumanSessionHost {
context.task_recency_window = self.task_recency_window;
context.autonomous_iter_cap = self.autonomous_iter_cap;
context.workspace = self.workspace_descriptor.clone();
+ // Sub-agents of this turn write their transcripts to this session's
+ // store, under the key it resolved for its own.
+ context.transcripts = Some(self.session_locator());
// The web backstop's deadline (`host_env.turn_deadline`), when this
// turn runs under one, is already on the context: the harness winds
// down before it instead of being dropped by it.
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/run_context.rs b/crates/openhuman-core/src/agent/tinyagents/host/run_context.rs
index b1b8df1577..045423f5a8 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/run_context.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/run_context.rs
@@ -312,6 +312,11 @@ pub struct OpenHumanRunContext {
/// The context the turn runs under, read by tools, middleware and the
/// provider factory instead of the ambient scope. Children inherit it.
pub core: Option<std::sync::Weak<crate::core::runtime::CoreContext>>,
+ /// The transcript store of this turn tree: the root session's own
+ /// (`OpenHumanSessionHost::session_locator`), so a sub-agent's transcript
+ /// lands beside its parent's under the same store key. Children inherit
+ /// it; `None` for a run no session started.
+ pub transcripts: Option<Arc<dyn tinyagents_session::transcript::TranscriptLocator>>,
/// File-state identity used to detect stale parent reads after child writes.
pub file_state_agent_id: Option<String>,
/// Host-owned artifact index for tool-result references.
@@ -446,6 +451,7 @@ impl OpenHumanRunContext {
prepared_context_sources: Arc::new(Vec::new()),
memory_identity: None,
core: None,
+ transcripts: None,
file_state_agent_id: None,
tool_result_artifact_index: None,
attachment_placeholders: Arc::new(Vec::new()),