Skip to content

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

fix(memory): include inference url and api key in prefetch fingerprint

Steven Enamakela4cfc5134690
diff --git a/crates/openhuman-core/src/memory/lifecycle/prefetch.rs b/crates/openhuman-core/src/memory/lifecycle/prefetch.rs
index a1397bf3c6..453eb204a6 100644
--- a/crates/openhuman-core/src/memory/lifecycle/prefetch.rs
+++ b/crates/openhuman-core/src/memory/lifecycle/prefetch.rs
@@ -93,6 +93,8 @@ fn memory_config_fingerprint(config: &Config) -> u64 {
config.config_path.hash(&mut fingerprint);
config.action_dir.hash(&mut fingerprint);
config.api_url.hash(&mut fingerprint);
+ config.inference_url.hash(&mut fingerprint);
+ config.api_key.hash(&mut fingerprint);
config.components.memory.hash(&mut fingerprint);
config.default_model.hash(&mut fingerprint);
config.chat_provider.hash(&mut fingerprint);
@@ -245,10 +247,12 @@ pub(crate) fn compaction(
let cache = cache(ctx);
let fingerprint = memory_config_fingerprint(&config);
let key = Key::with_fingerprint(&config, fingerprint, &identity, &thread, true);
- let pack = completed(&cache, &key)
- .or_else(|| {
- completed(&cache, &Key::with_fingerprint(&config, fingerprint, &identity, &thread, false))
- });
+ let pack = completed(&cache, &key).or_else(|| {
+ completed(
+ &cache,
+ &Key::with_fingerprint(&config, fingerprint, &identity, &thread, false),
+ )
+ });
enqueue(
cache,
key,
diff --git a/crates/openhuman-core/src/memory/lifecycle/prefetch_tests.rs b/crates/openhuman-core/src/memory/lifecycle/prefetch_tests.rs
index c0a128ec7e..f9a44083d9 100644
--- a/crates/openhuman-core/src/memory/lifecycle/prefetch_tests.rs
+++ b/crates/openhuman-core/src/memory/lifecycle/prefetch_tests.rs
@@ -104,6 +104,10 @@ fn prefetch_key_tracks_memory_config_without_hashing_unrelated_config() {
engine_changed.api_url = Some("https://memory.example.test".into());
assert!(key != Key::new(&engine_changed, &identity, "t", false));
+ let mut inference_changed = config.clone();
+ inference_changed.inference_url = Some("https://inference.example.test".into());
+ assert!(key != Key::new(&inference_changed, &identity, "t", false));
+
let mut unrelated_changed = config;
unrelated_changed.context.enabled = false;
assert!(key == Key::new(&unrelated_changed, &identity, "t", false));