Skip to content

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

chore: files changed src/openhuman/agent/experience/ops.rs,src/openhuman/memory/binding.rs

Steven Enamakel10405ee3a2b8
diff --git a/src/openhuman/agent/experience/ops.rs b/src/openhuman/agent/experience/ops.rs
index 5b6349dabb..98f00e494e 100644
--- a/src/openhuman/agent/experience/ops.rs
+++ b/src/openhuman/agent/experience/ops.rs
@@ -82,7 +82,8 @@ impl DriverMemory {
"[agent-experience] bound shared memory subtree driver='{}'",
binding.driver_id()
);
- Ok(binding.shared_memory_view(|provider| Arc::new(Self::new(Arc::clone(provider)))))
+ let memory: Arc<dyn Memory> = Arc::new(Self::new(binding.provider().clone()));
+ Ok(memory)
}
/// The driver bound for one memory subtree of `config`'s workspace.
@@ -104,7 +105,8 @@ impl DriverMemory {
"[agent-experience] bound memory subtree '{memory_subdir}' driver='{}'",
binding.driver_id()
);
- Ok(binding.shared_memory_view(|provider| Arc::new(Self::new(Arc::clone(provider)))))
+ let memory: Arc<dyn Memory> = Arc::new(Self::new(binding.provider().clone()));
+ Ok(memory)
}
}
diff --git a/src/openhuman/memory/binding.rs b/src/openhuman/memory/binding.rs
index ebf1ab1cbb..49c329ec30 100644
--- a/src/openhuman/memory/binding.rs
+++ b/src/openhuman/memory/binding.rs
@@ -85,18 +85,6 @@ pub struct MemoryBinding {
/// surface drift underneath an already-filtered RPC/tool registration.
capabilities: Capabilities,
fallback: Option<FallbackReason>,
- /// The `Arc<dyn Memory>` view over [`Self::provider`], built at most once
- /// per binding.
- ///
- /// Every session built against this subtree wants the same trait-object
- /// view of the same driver, and the view is stateless — it forwards each
- /// call to `provider`. Building one per session made each live agent hold
- /// its own allocation for a value indistinguishable from its neighbours'.
- /// Memoising it *here* rather than in a second cache is what keeps the
- /// lifetime right: the view dies with the binding, so the exit path's
- /// rebind (`forget_shut_down`) cannot leave a session holding a view over
- /// a driver that has already been torn down.
- memory_view: std::sync::OnceLock<Arc<dyn crate::openhuman::memory::Memory>>,
}
impl MemoryBinding {
@@ -109,17 +97,6 @@ impl MemoryBinding {
&self.provider
}
- /// The shared `Arc<dyn Memory>` view over this binding's driver.
- ///
- /// `make` runs at most once per binding; every later caller gets the same
- /// handle. See [`Self::memory_view`] for why the memo lives on the binding.
- pub fn shared_memory_view(
- &self,
- make: impl FnOnce(&Arc<dyn MemoryProvider>) -> Arc<dyn crate::openhuman::memory::Memory>,
- ) -> Arc<dyn crate::openhuman::memory::Memory> {
- Arc::clone(self.memory_view.get_or_init(|| make(&self.provider)))
- }
-
pub fn guard(&self) -> Arc<MemoryGuard> {
Arc::clone(&self.guard)
}
@@ -478,7 +455,6 @@ fn bind_provider(
class,
capabilities,
fallback,
- memory_view: std::sync::OnceLock::new(),
}
}