Skip to content

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

chore: The user wants a Conventional Commits message for a change, but the diff section is empty. Le

Steven Enamakel9d6c9ee200ee
diff --git a/crates/openhuman-embed/src/agent/build.rs b/crates/openhuman-embed/src/agent/build.rs
index 45d63ccf21..b6ad15d81a 100644
--- a/crates/openhuman-embed/src/agent/build.rs
+++ b/crates/openhuman-embed/src/agent/build.rs
@@ -2,7 +2,7 @@
//!
//! Order matters and is fixed here: validate the id, lay out directories,
//! assemble the per-agent `Config` (base → access → provider → MCP →
-//! Composio → escape hatch), build the definition, copy skills, check the
+//! Composio → memory binding → escape hatch), build the definition, copy skills, check the
//! narrowing rules, derive the context.
use std::path::Path;
@@ -76,6 +76,20 @@ pub(crate) fn instantiate(runtime: &Runtime, spec: AgentSpec) -> Result<AgentInn
config.composio.pin_host_credential(credential);
}
+ if let Some(binding) = parts.memory {
+ let agent_id = binding.agent_id().trim();
+ if agent_id.is_empty() {
+ return Err(AgentError::Invalid("a memory binding needs an agent id".into()));
+ }
+ if let Some(root) = binding.root_namespace() {
+ openhuman_core::memory::scope::validate_root(root)
+ .map_err(|reason| AgentError::Invalid(format!("memory root {root:?}: {reason}")))?;
+ }
+ log::debug!("[embed][agent] id={id} binds its memory agent_id={agent_id}");
+ config.memory.agent_id = Some(agent_id.to_string());
+ config.memory.root = binding.root_namespace().map(|root| root.trim().to_string());
+ }
+
if let Some(f) = parts.config_fn {
f(&mut config);
// Every agent shares the runtime's credential store and keyring; a
diff --git a/crates/openhuman-embed/src/agent/mod.rs b/crates/openhuman-embed/src/agent/mod.rs
index c54b0f7c9f..2362cdc2ec 100644
--- a/crates/openhuman-embed/src/agent/mod.rs
+++ b/crates/openhuman-embed/src/agent/mod.rs
@@ -23,7 +23,7 @@ pub(crate) mod spec;
pub use definition::{AgentDefinitionSpec, SandboxModeSpec, ToolScopeSpec};
pub use layout::AgentLayout;
-pub use spec::AgentSpec;
+pub use spec::{AgentSpec, MemoryBinding};
use std::path::Path;
use std::sync::Arc;
diff --git a/crates/openhuman-embed/src/lib.rs b/crates/openhuman-embed/src/lib.rs
index ce8477b192..1bc93bba16 100644
--- a/crates/openhuman-embed/src/lib.rs
+++ b/crates/openhuman-embed/src/lib.rs
@@ -97,7 +97,8 @@ mod turn;
pub use agent::ToolAttachmentError;
pub use agent::{
- Agent, AgentDefinitionSpec, AgentError, AgentLayout, AgentSpec, SandboxModeSpec, ToolScopeSpec,
+ Agent, AgentDefinitionSpec, AgentError, AgentLayout, AgentSpec, MemoryBinding, SandboxModeSpec,
+ ToolScopeSpec,
};
pub use auth::{Auth, AuthState, Session};
pub use config::{Config, RuntimeFlags};