Skip to content

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

test(subagent-sessions): cover owner and thread scoping in tiny port

Steven Enamakel943ebac255dd
diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/tiny_port_tests.rs b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/tiny_port_tests.rs
index a39c903e39..227f35d008 100644
--- a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/tiny_port_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/tiny_port_tests.rs
@@ -29,7 +29,11 @@ async fn old_rows_without_checkpoint_identity_remain_readable_without_fabricated
assert!(row.lifecycle_key.is_none());
store.save(&[row]).unwrap();
- let port = OpenHumanTinySubagentSessionStore::new(workspace.path().to_path_buf());
+ let port = OpenHumanTinySubagentSessionStore::new(
+ workspace.path().to_path_buf(),
+ "owner",
+ Some("thread".into()),
+ );
let sessions = port.list_for_parent("owner", Some("thread")).await.unwrap();
assert_eq!(sessions.len(), 1);
assert_eq!(sessions[0].subagent_session_id, "legacy-session");
@@ -40,4 +44,12 @@ async fn old_rows_without_checkpoint_identity_remain_readable_without_fabricated
.await
.unwrap()
.is_empty());
+ assert!(port.list_for_parent("owner", Some("other-thread")).await.unwrap().is_empty());
+ assert!(port.get("legacy-session").await.unwrap().is_some());
+ let other_thread = OpenHumanTinySubagentSessionStore::new(
+ workspace.path().to_path_buf(),
+ "owner",
+ Some("other-thread".into()),
+ );
+ assert!(other_thread.get("legacy-session").await.unwrap().is_none());
}
diff --git a/crates/openhuman-core/src/agent/subagent_host/lifecycle_tests.rs b/crates/openhuman-core/src/agent/subagent_host/lifecycle_tests.rs
index 03de7daeda..21ce8fffc6 100644
--- a/crates/openhuman-core/src/agent/subagent_host/lifecycle_tests.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/lifecycle_tests.rs
@@ -196,6 +196,8 @@ async fn tiny_session_port_recovers_legacy_key_from_owned_pause_and_hides_foreig
let port = crate::agent::orchestration::subagent_sessions::OpenHumanTinySubagentSessionStore::new(
workspace.path().to_path_buf(),
+ "owner-session",
+ Some("thread".into()),
);
let owned = port
.list_for_parent("owner-session", Some("thread"))
diff --git a/crates/openhuman-core/src/agent/tinyagents/tool_registration.rs b/crates/openhuman-core/src/agent/tinyagents/tool_registration.rs
index c1c7542bad..276dd8cc8a 100644
--- a/crates/openhuman-core/src/agent/tinyagents/tool_registration.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/tool_registration.rs
@@ -186,6 +186,8 @@ fn subagent_control_dispatches(
let store: Arc<dyn tinyagents_orchestration::subagent::SubagentSessionStore> = Arc::new(
crate::agent::orchestration::subagent_sessions::OpenHumanTinySubagentSessionStore::new(
parent.workspace_dir.clone(),
+ parent.session_id.clone(),
+ run_context.thread_id.clone(),
),
);
let owner = format!(