memory tool: point the tree test at real roots
MemoryRepo::new roots at {base}/{agent}/memory; the context
had to carry those roots, not the bare temp dirs. run 1795
went red because the handler opened a path that was never
a repository
This commit is contained in:
parent
7b45054f93
commit
5f7f23f30c
1 changed files with 6 additions and 2 deletions
|
|
@ -2214,6 +2214,10 @@ mod tests {
|
||||||
async fn memory_tool_tree_names_the_target_root() {
|
async fn memory_tool_tree_names_the_target_root() {
|
||||||
let default_dir = TempDir::new().unwrap();
|
let default_dir = TempDir::new().unwrap();
|
||||||
let primary_dir = TempDir::new().unwrap();
|
let primary_dir = TempDir::new().unwrap();
|
||||||
|
// `MemoryRepo::new` roots at `{base}/{agent}/memory`; the context must
|
||||||
|
// point at those roots, not the bases.
|
||||||
|
let default_root = default_dir.path().join("test-agent").join("memory");
|
||||||
|
let primary_root = primary_dir.path().join("test-agent").join("memory");
|
||||||
MemoryRepo::new("test-agent", default_dir.path())
|
MemoryRepo::new("test-agent", default_dir.path())
|
||||||
.init()
|
.init()
|
||||||
.await
|
.await
|
||||||
|
|
@ -2225,8 +2229,8 @@ mod tests {
|
||||||
|
|
||||||
let mut ctx = ToolContext::new();
|
let mut ctx = ToolContext::new();
|
||||||
ctx.agent_id = Some("test-agent".to_string());
|
ctx.agent_id = Some("test-agent".to_string());
|
||||||
ctx.memory_root = Some(default_dir.path().to_path_buf());
|
ctx.memory_root = Some(default_root);
|
||||||
ctx.memory_trees = vec![("primary".to_string(), primary_dir.path().to_path_buf())];
|
ctx.memory_trees = vec![("primary".to_string(), primary_root)];
|
||||||
|
|
||||||
let write = handle_memory_tool_with_context(
|
let write = handle_memory_tool_with_context(
|
||||||
"memory",
|
"memory",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue