Skip to content

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

fix(memory): set root namespace on backfilled conversation turns

Steven Enamakelb0833482a017
diff --git a/crates/openhuman-core/src/memory/conversations/backfill.rs b/crates/openhuman-core/src/memory/conversations/backfill.rs
index 4b277646d5..5b683c23a9 100644
--- a/crates/openhuman-core/src/memory/conversations/backfill.rs
+++ b/crates/openhuman-core/src/memory/conversations/backfill.rs
@@ -142,6 +142,8 @@ pub fn turns_of(thread_id: &str, messages: &[ConversationMessage]) -> Vec<Commit
turns.push(CommittedTurn {
thread_id: thread_id.to_string(),
agent_id: None,
+ // Past chats are the main agent's: the shared root.
+ namespace: tinymemory::Namespace::ROOT,
workspace: None,
channel: None,
user: text.to_string(),
@@ -156,6 +158,8 @@ pub fn turns_of(thread_id: &str, messages: &[ConversationMessage]) -> Vec<Commit
turns.push(CommittedTurn {
thread_id: thread_id.to_string(),
agent_id: None,
+ // Past chats are the main agent's: the shared root.
+ namespace: tinymemory::Namespace::ROOT,
workspace: None,
channel: None,
user: String::new(),
diff --git a/crates/openhuman-core/src/memory/conversations/mod_tests.rs b/crates/openhuman-core/src/memory/conversations/mod_tests.rs
index 2d1b7df646..783beb1ab9 100644
--- a/crates/openhuman-core/src/memory/conversations/mod_tests.rs
+++ b/crates/openhuman-core/src/memory/conversations/mod_tests.rs
@@ -7,6 +7,7 @@ fn turn(thread: &str, text: &str, at: DateTime<Utc>) -> CommittedTurn {
CommittedTurn {
thread_id: thread.to_string(),
agent_id: Some("orchestrator".into()),
+ namespace: tinymemory::Namespace::ROOT,
workspace: Some("/work".into()),
channel: Some("web".into()),
user: text.to_string(),