Skip to content

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

test(subagent_sessions): use context-scoped session store in e2e driver test

Steven Enamakeldc81fdb219ba
diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/mod.rs b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/mod.rs
index 85f91edd1b..89d312c5d7 100644
--- a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/mod.rs
+++ b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/mod.rs
@@ -12,7 +12,7 @@ pub use ops::{
mark_driver_pause_cancelled, mark_failed, mark_finished, normalize_task_key,
resolve_lifecycle_key, reuse_decision, upsert_running, DriverTaskCancellation,
};
-pub(crate) use tiny_port::OpenHumanTinySubagentSessionStore;
+pub(crate) use tiny_port::{open_for_context, OpenHumanTinySubagentSessionStore};
pub use types::{
DurableSubagentStatus, SubagentSessionSelector, SubagentSessionStore, SubagentSessionUpsert,
};
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_driver_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_driver_tests.rs
index aceee5073f..6e4b7f6573 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_driver_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_driver_tests.rs
@@ -198,18 +198,18 @@ async fn force_fresh_cancels_old_driver_before_creating_a_new_session() {
release_first.notify_one();
release_second.notify_one();
- let session_port =
- crate::agent::orchestration::subagent_sessions::OpenHumanTinySubagentSessionStore::new(
- workspace.clone(),
- "force-fresh-parent-session",
- Some("force-fresh-parent-thread".into()),
- );
+ let session_port = crate::agent::orchestration::subagent_sessions::open_for_context(
+ &crate::core::runtime::DispatchCtx::new(Arc::clone(&core)),
+ workspace.clone(),
+ "force-fresh-parent-session",
+ Some("force-fresh-parent-thread".into()),
+ Some((*jobs).clone()),
+ )
+ .expect("open explicitly scoped force-fresh session store");
let wait = SubAgentJobsTool::new((*jobs).clone())
.with_fixed_action(tinyagents_harness_tools::subagents::SubAgentJobAction::Await)
.with_identifier_fields("task_id", "subagent_session_id")
- .with_sessions(Arc::new(session_port), |_| {
- "force-fresh-parent-session".to_owned()
- })
+ .with_sessions(session_port, |_| "force-fresh-parent-session".to_owned())
.with_owner_scope(Arc::new({
let owner = crate::agent::tinyagents::tool_registration::subagent_owner_key(
&workspace,