From b95cd9a02a5e02ac72b755a48ba8108df2815421 Mon Sep 17 00:00:00 2001 From: Kevin Lin Date: Tue, 10 Feb 2026 21:48:04 -0800 Subject: [PATCH] fix: detach memory tools on startup when memfs is enabled (#909) Co-authored-by: Letta --- src/index.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/index.ts b/src/index.ts index 826b006..95a2407 100755 --- a/src/index.ts +++ b/src/index.ts @@ -1697,6 +1697,15 @@ async function main(): Promise { settingsManager.setMemfsEnabled(agent.id, true); } + // When memfs is being enabled, detach old API-based memory tools + if ( + settingsManager.isMemfsEnabled(agent.id) && + (memfsFlag || (isNewlyCreatedAgent && !isSubagent)) + ) { + const { detachMemoryTools } = await import("./tools/toolset"); + await detachMemoryTools(agent.id); + } + // Ensure agent's system prompt includes/excludes memfs section to match setting if (memfsFlag || noMemfsFlag || (isNewlyCreatedAgent && !isSubagent)) { const { updateAgentSystemPromptMemfs } = await import(