refactor: rename memory tool set and update CLI alias handling

This commit is contained in:
kartik-mem0
2026-04-06 16:24:37 +05:30
parent f8c6ccf5fe
commit 566bbeb018
2 changed files with 11 additions and 11 deletions
+4 -4
View File
@@ -775,14 +775,14 @@ function registerHooks(
// Update shared state for tools (best-effort — tools don't have ctx)
if (sessionId) session.setCurrentSessionId(sessionId);
const MEMORY_WRITE_TOOLS = new Set(["memory_add", "memory_update"]);
const agentUsedWriteTool = event.messages.some((msg: any) => {
const MEMORY_MUTATE_TOOLS = new Set(["memory_add", "memory_update", "memory_delete"]);
const agentUsedMemoryTool = event.messages.some((msg: any) => {
if (msg?.role !== "assistant" || !Array.isArray(msg?.content)) return false;
return msg.content.some(
(block: any) => block?.type === "tool_use" && MEMORY_WRITE_TOOLS.has(block.name),
(block: any) => block?.type === "tool_use" && MEMORY_MUTATE_TOOLS.has(block.name),
);
});
if (agentUsedWriteTool) {
if (agentUsedMemoryTool) {
api.logger.info(
"openclaw-mem0: skipping auto-capture — agent already used memory tools this turn",
);