Skip to content

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

feat(profiles): add property and host tests for gateway profiles

Steven Enamakelbefe2ac588cf
diff --git a/crates/openhuman-core/src/profiles/gateway_proptest_tests.rs b/crates/openhuman-core/src/profiles/gateway_proptest_tests.rs
index 982f470914..35c19568ce 100644
--- a/crates/openhuman-core/src/profiles/gateway_proptest_tests.rs
+++ b/crates/openhuman-core/src/profiles/gateway_proptest_tests.rs
@@ -219,7 +219,8 @@ proptest! {
Ok(profile) => {
let expected = ProfileId::for_user(&user, mode).unwrap();
prop_assert_eq!(&profile.id, &expected, "{:?} landed on another profile", user);
- prop_assert_eq!(profile.context().session_agent(), Some(expected.as_str()));
+ prop_assert_eq!(profile.context().profile(), Some(expected.as_str()));
+ prop_assert_eq!(profile.context().session_agent(), None);
prop_assert!(PROVISIONED.contains(&user.as_str()), "{:?} opened", user);
prop_assert!(is_valid_for(&user, header.as_deref().unwrap_or("")));
}
diff --git a/crates/openhuman-core/src/profiles/host_tests.rs b/crates/openhuman-core/src/profiles/host_tests.rs
index caaf9761d6..21aa2d620e 100644
--- a/crates/openhuman-core/src/profiles/host_tests.rs
+++ b/crates/openhuman-core/src/profiles/host_tests.rs
@@ -46,8 +46,12 @@ async fn an_open_profile_runs_under_its_own_scope() {
let state_a = host.open(&a).await.unwrap();
let state_b = host.open(&b).await.unwrap();
- assert_eq!(state_a.context().session_agent(), Some(a.as_str()));
- assert_eq!(state_b.context().session_agent(), Some(b.as_str()));
+ // A profile's default agent runs as the desktop's does: no agent id, the
+ // profile is the tenant key.
+ assert_eq!(state_a.context().session_agent(), None);
+ assert_eq!(state_b.context().session_agent(), None);
+ assert_eq!(state_a.context().profile(), Some(a.as_str()));
+ assert_eq!(state_b.context().profile(), Some(b.as_str()));
let config_a = state_a.context().embedder_config().unwrap();
let config_b = state_b.context().embedder_config().unwrap();
assert_ne!(config_a.workspace_dir, config_b.workspace_dir);