Skip to content

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

test(config): update tests for document snapshot API

Steven Enamakelf23a8d284434
diff --git a/crates/openhuman-core/src/config/schema/load/source/concurrency_tests.rs b/crates/openhuman-core/src/config/schema/load/source/concurrency_tests.rs
index ffbf857eca..6405b93a5c 100644
--- a/crates/openhuman-core/src/config/schema/load/source/concurrency_tests.rs
+++ b/crates/openhuman-core/src/config/schema/load/source/concurrency_tests.rs
@@ -144,7 +144,7 @@ async fn config_snapshot_cannot_be_saved_into_a_different_tenant_scope() {
let config = Config::load_from_config_path(&path, &workspace)
.await
.unwrap();
- let version = *config.document_version.lock().unwrap();
+ let version = config.document_snapshot.lock().unwrap().version;
(config, version)
};
@@ -158,7 +158,7 @@ async fn config_snapshot_cannot_be_saved_into_a_different_tenant_scope() {
let config = Config::load_from_config_path(&path, &workspace)
.await
.unwrap();
- let version = *config.document_version.lock().unwrap();
+ let version = config.document_snapshot.lock().unwrap().version;
let docs = Arc::clone(scoped(&storage, "tenant-source-b").documents());
let stored = docs
.get(
diff --git a/crates/openhuman-core/src/config/schema/load/source/mod_tests.rs b/crates/openhuman-core/src/config/schema/load/source/mod_tests.rs
index f1b122ae69..91fef4070a 100644
--- a/crates/openhuman-core/src/config/schema/load/source/mod_tests.rs
+++ b/crates/openhuman-core/src/config/schema/load/source/mod_tests.rs
@@ -29,6 +29,7 @@ fn document_source_keyed(
Scope::new(scope).unwrap(),
keys,
FileConfigSource::new(file),
+ Arc::as_ptr(scoped(storage, scope).documents()) as *const () as usize,
)
}
diff --git a/crates/openhuman-core/src/core/runtime/context_test_support.rs b/crates/openhuman-core/src/core/runtime/context_test_support.rs
index bbdebf06a5..65dbba079e 100644
--- a/crates/openhuman-core/src/core/runtime/context_test_support.rs
+++ b/crates/openhuman-core/src/core/runtime/context_test_support.rs
@@ -60,6 +60,8 @@ impl CoreContext {
domains: crate::core::runtime::DomainSet,
config: crate::config::Config,
) -> Arc<CoreContext> {
+ let latest_embedder_config = Arc::new(std::sync::Mutex::new(config.clone()));
+ crate::config::Config::bind_context_snapshot(&latest_embedder_config);
Arc::new(CoreContext {
host_kind: HostKind::Cli,
workspace_binding: RwLock::new(Arc::new(RwLock::new(WorkspaceBinding {
@@ -69,7 +71,7 @@ impl CoreContext {
tool_groups: Default::default(),
components: Default::default(),
embedder_config: Some(config),
- latest_embedder_config: None,
+ latest_embedder_config: Some(latest_embedder_config),
user_skill_roots: true,
extensions: Default::default(),
turn_origin: None,