Skip to content

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

chore: files changed crates/openhuman-core/src/config/schema/load/context_overlay.rs,crates/openhuma

Steven Enamakel03b0b7f5e9de
diff --git a/crates/openhuman-core/src/config/schema/load/context_overlay.rs b/crates/openhuman-core/src/config/schema/load/context_overlay.rs
index a69e257dc0..f1b1d817cb 100644
--- a/crates/openhuman-core/src/config/schema/load/context_overlay.rs
+++ b/crates/openhuman-core/src/config/schema/load/context_overlay.rs
@@ -47,7 +47,8 @@ impl ConfigContextOverlay {
}
pub(crate) fn reapply(&self, fresh: &Config) -> anyhow::Result<Config> {
- let mut value = serde_json::to_value(fresh)?;
+ let fresh_persisted = serde_json::to_value(fresh)?;
+ let mut value = fresh_persisted.clone();
for change in &self.changes {
apply_change(&mut value, &change.path, change.value.clone());
}
@@ -57,7 +58,11 @@ impl ConfigContextOverlay {
result.document_snapshot =
std::sync::Mutex::new(fresh.document_snapshot.lock().unwrap().clone());
result.context_snapshot = fresh.context_snapshot.clone();
- result.context_overlay = std::sync::Mutex::new(Some(Arc::new(self.clone())));
+ result.context_overlay = std::sync::Mutex::new(Some(Arc::new(Self {
+ base: fresh_persisted,
+ changes: self.changes.clone(),
+ runtime: self.runtime.clone(),
+ })));
Ok(result)
}
}
@@ -101,9 +106,15 @@ fn apply_change(current: &mut Value, path: &[String], value: Option<Value>) {
}
return;
};
- let Some(object) = current.as_object_mut() else {
- return;
- };
+ if !current.is_object() {
+ if value.is_none() {
+ return;
+ }
+ *current = Value::Object(Default::default());
+ }
+ let object = current
+ .as_object_mut()
+ .expect("object created for nested config override");
if rest.is_empty() {
if let Some(value) = value {
object.insert(key.clone(), value);
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 70acc92d02..bf614c1fa6 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,7 +11,8 @@ async fn agent_registry_rpc_preserves_document_conflicts() {
Scope::new("tenant-rpc").unwrap(),
keys(9),
);
- 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 stale = Config::load_from_config_path(&seed.config_path, &seed.workspace_dir)
.await
@@ -196,6 +197,7 @@ async fn external_config_conflict_refresh_keeps_derived_runtime_overrides() {
runtime_config.memory.root = Some("team:runtime".into());
runtime_config.mcp_client.enabled = false;
runtime_config.autonomy.enabled = true;
+ runtime_config.output_language = None;
runtime_config.composio.pin_host_credential(
crate::config::schema::ComposioHostCredential::direct("overlay-only-test-secret"),
);
@@ -210,6 +212,7 @@ async fn external_config_conflict_refresh_keeps_derived_runtime_overrides() {
.await
.unwrap();
external.default_model = Some("external-winner".into());
+ external.default_temperature = 0.4;
external.save().await.unwrap();
let controller = crate::core::all::all_registered_controllers()
@@ -235,6 +238,8 @@ async fn external_config_conflict_refresh_keeps_derived_runtime_overrides() {
})
.await;
assert_eq!(refreshed.default_model.as_deref(), Some("external-winner"));
+ assert!((refreshed.default_temperature - 0.4).abs() < f64::EPSILON);
+ assert!(refreshed.output_language.is_none());
assert_eq!(
refreshed.memory.agent_id.as_deref(),
Some("runtime-memory-agent")