Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust

test(run): keep the store-override fixture inside the custom store on Windows

AkitaOnRails90073cb7ec8b
diff --git a/crates/ai-memory-cli/src/commands/run.rs b/crates/ai-memory-cli/src/commands/run.rs
index 565f321b..4a586b42 100644
--- a/crates/ai-memory-cli/src/commands/run.rs
+++ b/crates/ai-memory-cli/src/commands/run.rs
@@ -4691,9 +4691,12 @@ mod tests {
std::fs::create_dir_all(&cwd).unwrap();
let cwd = cwd.canonicalize().unwrap();
let write_session = |config_dir: &Path, id: &str| {
- let bucket = config_dir
- .join("projects")
- .join(cwd.to_string_lossy().replace('/', "-"));
+ // Flatten the whole path: on Windows the canonical cwd is an
+ // absolute `\\?\C:\…` path, and joining it would escape the store.
+ let bucket = config_dir.join("projects").join(
+ cwd.to_string_lossy()
+ .replace(|c: char| !c.is_ascii_alphanumeric(), "-"),
+ );
std::fs::create_dir_all(&bucket).unwrap();
let line = serde_json::json!({
"type": "user",