Skip to content

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

test(embed): assert reopened session key structure instead of exact match

Steven Enamakeled27258a5cab
diff --git a/crates/openhuman-embed/tests/profile_host_capabilities.rs b/crates/openhuman-embed/tests/profile_host_capabilities.rs
index e9db0eff58..88fca1a2f0 100644
--- a/crates/openhuman-embed/tests/profile_host_capabilities.rs
+++ b/crates/openhuman-embed/tests/profile_host_capabilities.rs
@@ -530,12 +530,15 @@ async fn scenario() {
);
{
let reopened_sessions = sessions.lock().unwrap();
- assert_eq!(
- &reopened_sessions[reopened_sessions.len() - 2..],
- [
- ("alice".into(), Some("t1".into())),
- ("alice".into(), Some("channel:telegram/sender/chat".into()))
- ]
+ let tail = &reopened_sessions[reopened_sessions.len() - 2..];
+ assert_eq!(tail[0], ("alice".into(), Some("t1".into())));
+ let (profile, key) = &tail[1];
+ assert_eq!(profile, "alice");
+ assert!(
+ key.as_deref()
+ .is_some_and(|key| key.contains("|channel=p8:telegram|")
+ && key.contains("|participant=p6:sender")),
+ "{key:?}"
);
}
handles.insert(0, reopened);