Skip to content

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

fix(memory): include engine config in prefetch fingerprint

Steven Enamakeldb00e76043c2
diff --git a/crates/openhuman-core/src/config/schema/routes.rs b/crates/openhuman-core/src/config/schema/routes.rs
index 3bb9c88d75..500bad7616 100644
--- a/crates/openhuman-core/src/config/schema/routes.rs
+++ b/crates/openhuman-core/src/config/schema/routes.rs
@@ -3,7 +3,7 @@
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
-#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
+#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, Hash)]
pub struct ModelRouteConfig {
pub hint: String,
pub model: String,
diff --git a/crates/openhuman-core/src/memory/lifecycle/prefetch.rs b/crates/openhuman-core/src/memory/lifecycle/prefetch.rs
index 4459f2b20c..a1397bf3c6 100644
--- a/crates/openhuman-core/src/memory/lifecycle/prefetch.rs
+++ b/crates/openhuman-core/src/memory/lifecycle/prefetch.rs
@@ -91,6 +91,14 @@ fn memory_config_fingerprint(config: &Config) -> u64 {
let mut fingerprint = std::collections::hash_map::DefaultHasher::new();
config.memory.hash(&mut fingerprint);
config.config_path.hash(&mut fingerprint);
+ config.action_dir.hash(&mut fingerprint);
+ config.api_url.hash(&mut fingerprint);
+ config.components.memory.hash(&mut fingerprint);
+ config.default_model.hash(&mut fingerprint);
+ config.chat_provider.hash(&mut fingerprint);
+ config.memory_provider.hash(&mut fingerprint);
+ config.model_routes.hash(&mut fingerprint);
+ config.time_zone().hash(&mut fingerprint);
fingerprint.finish()
}
diff --git a/crates/openhuman-core/src/memory/lifecycle/prefetch_tests.rs b/crates/openhuman-core/src/memory/lifecycle/prefetch_tests.rs
index 32a3cd1e85..c0a128ec7e 100644
--- a/crates/openhuman-core/src/memory/lifecycle/prefetch_tests.rs
+++ b/crates/openhuman-core/src/memory/lifecycle/prefetch_tests.rs
@@ -100,6 +100,10 @@ fn prefetch_key_tracks_memory_config_without_hashing_unrelated_config() {
memory_changed.memory.recall.brain_limit += 1;
assert!(key != Key::new(&memory_changed, &identity, "t", false));
+ let mut engine_changed = config.clone();
+ engine_changed.api_url = Some("https://memory.example.test".into());
+ assert!(key != Key::new(&engine_changed, &identity, "t", false));
+
let mut unrelated_changed = config;
unrelated_changed.context.enabled = false;
assert!(key == Key::new(&unrelated_changed, &identity, "t", false));