Skip to content

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

fix(agent): require selector match when reusing driver session

Steven Enamakel0dc1cedab72c
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_host_impl.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_host_impl.rs
index fde765f188..415d415836 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_host_impl.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_host_impl.rs
@@ -31,6 +31,7 @@ async fn find_reusable_driver_session(
.map(|sessions| {
sessions.into_iter().find(|session| {
session.subagent_session_id == selected.subagent_session_id
+ && session.matches_selector(selector)
})
})
}