Skip to content

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

test(orchestration): cover workspace router cache isolation

Steven Enamakele5d7f70a5a8a
diff --git a/crates/openhuman-core/src/agent/orchestration/completion_target_tests.rs b/crates/openhuman-core/src/agent/orchestration/completion_target_tests.rs
index 3a171a4ee5..6f4636b803 100644
--- a/crates/openhuman-core/src/agent/orchestration/completion_target_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/completion_target_tests.rs
@@ -80,3 +80,18 @@ pub(crate) fn forget_workspace_for_test(workspace_dir: &Path) {
}
let _ = router_pool().remove(&ambient_scope);
}
+
+#[test]
+fn forgetting_one_workspace_keeps_other_cached_routers() {
+ let first = TestWorkspace::new();
+ let second = TestWorkspace::new();
+ let second_router = entry_for(second.path()).router;
+
+ forget_workspace_for_test(first.path());
+
+ let still_cached = router_pool()
+ .get(&router_scope(second.path()))
+ .expect("lookup second workspace router")
+ .expect("second workspace remains cached");
+ assert!(Arc::ptr_eq(&still_cached, &second_router));
+}