Skip to content

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

fix(config): clear stale context overlay on config reload

Steven Enamakelc900fecac477
diff --git a/crates/openhuman-core/src/config/schema/load/impl_load.rs b/crates/openhuman-core/src/config/schema/load/impl_load.rs
index 2a2e7aa390..c28c7b21ce 100644
--- a/crates/openhuman-core/src/config/schema/load/impl_load.rs
+++ b/crates/openhuman-core/src/config/schema/load/impl_load.rs
@@ -458,6 +458,7 @@ impl Config {
version,
anchor: Some(source_anchor.clone()),
};
+ *self.context_overlay.lock().unwrap() = None;
if let Some(snapshot) = self
.context_snapshot
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 bf614c1fa6..93f80becda 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
@@ -11,8 +11,7 @@ async fn agent_registry_rpc_preserves_document_conflicts() {
Scope::new("tenant-rpc").unwrap(),
keys(9),
);
- let mut seed = config_at(tmp.path(), "initial");
- seed.output_language = Some("seed-language".into());
+ let seed = config_at(tmp.path(), "initial");
seed.save().await.unwrap();
let stale = Config::load_from_config_path(&seed.config_path, &seed.workspace_dir)
.await
@@ -184,11 +183,13 @@ async fn external_config_conflict_refresh_keeps_derived_runtime_overrides() {
Scope::new("tenant-refresh-overlay").unwrap(),
keys(14),
);
- let seed = config_at(tmp.path(), "initial");
+ let mut seed = config_at(tmp.path(), "initial");
+ seed.output_language = Some("seed-language".into());
seed.save().await.unwrap();
let mut runtime_config = Config::load_from_config_path(&seed.config_path, &seed.workspace_dir)
.await
.unwrap();
+ let parent = CoreContext::for_test_with_config(DomainSet::full(), runtime_config.clone());
assert!(runtime_config.mcp_client.enabled);
assert!(!runtime_config.autonomy.enabled);
assert!(runtime_config.memory.agent_id.is_none());
@@ -201,7 +202,6 @@ async fn external_config_conflict_refresh_keeps_derived_runtime_overrides() {
runtime_config.composio.pin_host_credential(
crate::config::schema::ComposioHostCredential::direct("overlay-only-test-secret"),
);
- let parent = CoreContext::for_test_with_config(DomainSet::full(), runtime_config.clone());
let ctx = parent.derive_with(ContextOverlay::new(
runtime_config,
DomainSet::full(),