Skip to content

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

Rust

test(audit): reconcile final release gates

AkitaOnRails181bfc8868f0
diff --git a/crates/ai-memory-cli/src/commands/install_mcp.rs b/crates/ai-memory-cli/src/commands/install_mcp.rs
index 8c8ac7fa..e80b34f2 100644
--- a/crates/ai-memory-cli/src/commands/install_mcp.rs
+++ b/crates/ai-memory-cli/src/commands/install_mcp.rs
@@ -6388,10 +6388,33 @@ mod tests {
#\n\
[mcp_servers.ai-memory]\n\
url = \"http://127.0.0.1:49374/mcp\"\n\
- # Skip per-call approval prompts on ai-memory's tools.\n\
- # ai-memory is read-mostly + writes are auto-capture; the\n\
- # approval friction makes it unusable otherwise.\n\
- default_tools_approval_mode = \"approve\"\n"
+ # Skip per-call approval prompts on ai-memory's read tools;\n\
+ # the destructive ones below still ask first.\n\
+ default_tools_approval_mode = \"approve\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_delete_page]\n\
+ approval_mode = \"prompt\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_feedback]\n\
+ approval_mode = \"prompt\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_forget_sweep]\n\
+ approval_mode = \"prompt\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_handoff_accept]\n\
+ approval_mode = \"prompt\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_handoff_cancel]\n\
+ approval_mode = \"prompt\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_message_cancel]\n\
+ approval_mode = \"prompt\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_message_pop]\n\
+ approval_mode = \"prompt\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_restore_page]\n\
+ approval_mode = \"prompt\"\n"
);
let mut with_token = args_with_token(McpClient::Codex);
@@ -6402,13 +6425,36 @@ mod tests {
#\n\
[mcp_servers.ai-memory]\n\
url = \"http://127.0.0.1:49374/mcp\"\n\
- # Skip per-call approval prompts on ai-memory's tools.\n\
- # ai-memory is read-mostly + writes are auto-capture; the\n\
- # approval friction makes it unusable otherwise.\n\
+ # Skip per-call approval prompts on ai-memory's read tools;\n\
+ # the destructive ones below still ask first.\n\
default_tools_approval_mode = \"approve\"\n\
\n\
[mcp_servers.ai-memory.http_headers]\n\
Authorization = \"Bearer test-token-deadbeef\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_delete_page]\n\
+ approval_mode = \"prompt\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_feedback]\n\
+ approval_mode = \"prompt\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_forget_sweep]\n\
+ approval_mode = \"prompt\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_handoff_accept]\n\
+ approval_mode = \"prompt\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_handoff_cancel]\n\
+ approval_mode = \"prompt\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_message_cancel]\n\
+ approval_mode = \"prompt\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_message_pop]\n\
+ approval_mode = \"prompt\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_restore_page]\n\
+ approval_mode = \"prompt\"\n\
# Alternative (avoids embedding the literal token):\n\
# bearer_token_env_var = \"AI_MEMORY_AUTH_TOKEN\"\n\
# — and export AI_MEMORY_AUTH_TOKEN in your shell init.\n"
@@ -6424,11 +6470,34 @@ mod tests {
#\n\
[mcp_servers.ai-memory]\n\
url = \"http://127.0.0.1:49374/mcp\"\n\
- # Skip per-call approval prompts on ai-memory's tools.\n\
- # ai-memory is read-mostly + writes are auto-capture; the\n\
- # approval friction makes it unusable otherwise.\n\
+ # Skip per-call approval prompts on ai-memory's read tools;\n\
+ # the destructive ones below still ask first.\n\
default_tools_approval_mode = \"approve\"\n\
bearer_token_env_var = \"{PRIME_AGENT_TOKEN_ENV}\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_delete_page]\n\
+ approval_mode = \"prompt\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_feedback]\n\
+ approval_mode = \"prompt\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_forget_sweep]\n\
+ approval_mode = \"prompt\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_handoff_accept]\n\
+ approval_mode = \"prompt\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_handoff_cancel]\n\
+ approval_mode = \"prompt\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_message_cancel]\n\
+ approval_mode = \"prompt\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_message_pop]\n\
+ approval_mode = \"prompt\"\n\
+ \n\
+ [mcp_servers.ai-memory.tools.memory_restore_page]\n\
+ approval_mode = \"prompt\"\n\
# The token is read from ${PRIME_AGENT_TOKEN_ENV}; export it where you launch codex.\n"
)
);
diff --git a/crates/ai-memory-core/src/sanitize.rs b/crates/ai-memory-core/src/sanitize.rs
index 8dce3c67..e4a47014 100644
--- a/crates/ai-memory-core/src/sanitize.rs
+++ b/crates/ai-memory-core/src/sanitize.rs
@@ -406,7 +406,7 @@ impl Sanitizer {
let secret_group = re.capture_names().any(|name| name == Some("secret"));
patterns.push(Pattern {
re,
- label: *label,
+ label,
secret_group,
});
}
diff --git a/crates/ai-memory-store/src/reader.rs b/crates/ai-memory-store/src/reader.rs
index 5bdc50e1..3cb6c1fb 100644
--- a/crates/ai-memory-store/src/reader.rs
+++ b/crates/ai-memory-store/src/reader.rs
@@ -477,7 +477,7 @@ fn push_html_escaped(out: &mut String, input: &str) {
}
}
-fn serialize_highlighted_snippet<S>(snippet: &String, serializer: S) -> Result<S::Ok, S::Error>
+fn serialize_highlighted_snippet<S>(snippet: &str, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
diff --git a/crates/ai-memory-workstream/src/transcript.rs b/crates/ai-memory-workstream/src/transcript.rs
index 42e1c1a4..26e1264d 100644
--- a/crates/ai-memory-workstream/src/transcript.rs
+++ b/crates/ai-memory-workstream/src/transcript.rs
@@ -9723,7 +9723,7 @@ mod tests {
exported
.losses
.iter()
- .any(|loss| loss.contains("history.jsonl is missing")),
+ .any(|loss| loss.contains("history.jsonl and brain transcript are missing")),
"{:?}",
exported.losses
);