identity: load ContextSource::Store from graph, not flat files
ContextSource::Store was handled identically to File — reading .md files from disk. Now uses MemoryNode::load() to read from the capnp store. This is why personality wasn't showing correctly in poc-agent: store-sourced context groups (cognitive-modes, stuck-toolkit, instructions, memory-instructions-core) were being looked up as flat files and silently missing. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
164a603c8e
commit
b88b05fe07
1 changed files with 9 additions and 4 deletions
|
|
@ -93,11 +93,17 @@ fn load_memory_files(cwd: &Path, memory_project: Option<&Path>, context_groups:
|
||||||
// Journal loading handled separately
|
// Journal loading handled separately
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ContextSource::File | ContextSource::Store => {
|
ContextSource::Store => {
|
||||||
// File source - load each key as a file
|
// Load from the memory graph store
|
||||||
|
for key in &group.keys {
|
||||||
|
if let Some(node) = crate::hippocampus::memory::MemoryNode::load(key) {
|
||||||
|
memories.push((key.clone(), node.content));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ContextSource::File => {
|
||||||
for key in &group.keys {
|
for key in &group.keys {
|
||||||
let filename = format!("{}.md", key);
|
let filename = format!("{}.md", key);
|
||||||
// Try config dir first, then project, then global
|
|
||||||
if let Some(content) = read_nonempty(&config_dir.join(&filename)) {
|
if let Some(content) = read_nonempty(&config_dir.join(&filename)) {
|
||||||
memories.push((key.clone(), content));
|
memories.push((key.clone(), content));
|
||||||
} else if let Some(content) = load_memory_file(&filename, project.as_deref(), &global) {
|
} else if let Some(content) = load_memory_file(&filename, project.as_deref(), &global) {
|
||||||
|
|
@ -105,7 +111,6 @@ fn load_memory_files(cwd: &Path, memory_project: Option<&Path>, context_groups:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// All variants covered
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue