Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
test(importer): rerun a long vault page against a real server
João Matheus23d7d7f23212
diff --git a/companions/ai-memory-importer/src/agentmemory/e2e.rs b/companions/ai-memory-importer/src/agentmemory/e2e.rsindex 8376c91d..60f06236 100644--- a/companions/ai-memory-importer/src/agentmemory/e2e.rs+++ b/companions/ai-memory-importer/src/agentmemory/e2e.rs@@ -160,6 +160,42 @@ async fn e2e_vault_import_is_searchable_and_idempotent() {assert_eq!(second["present_versions"], 5);}+/// The server returns 12,000 characters of a body unless the caller asks for+/// more (#1827). A rerun asks for the whole body before comparing it, so a+/// page longer than that is still found present.+#[tokio::test]+async fn e2e_vault_rerun_finds_a_long_page_present() {+ let Some(server) = start().await else { return };+ let vault_dir = tempfile::tempdir().unwrap();+ let page = vault_dir.path().join("memories/long.md");+ std::fs::create_dir_all(page.parent().unwrap()).unwrap();+ let line = "Every mutation goes through one writer thread.\n";+ std::fs::write(+ &page,+ format!("---\nid: \"long\"\n---\n# Long\n\n{}", line.repeat(500)),+ )+ .unwrap();+ let manifest_path = vault_dir.path().join("manifest.json");+ let args = || VaultArgs {+ dir: vault_dir.path().to_path_buf(),+ workspace: Some("e2e".into()),+ project: Some("long".into()),+ dest_prefix: DEFAULT_DEST_PREFIX.into(),+ server_url: server.url.clone(),+ apply: true,+ manifest_out: Some(manifest_path.clone()),+ create_destination: true,+ show_body: false,+ };++ vault::run(args()).await.unwrap();+ assert_eq!(manifest(&manifest_path)["written_versions"], 1);+ vault::run(args()).await.unwrap();+ let second = manifest(&manifest_path);+ assert_eq!(second["written_versions"], 0, "{second}");+ assert_eq!(second["present_versions"], 1, "{second}");+}+#[tokio::test]async fn e2e_export_import_rebuilds_chains_and_honours_ttl() {let Some(server) = start().await else { return };