fix: detach memory tools on startup when memfs is enabled (#909)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Kevin Lin
2026-02-10 21:48:04 -08:00
committed by GitHub
parent 85d2a27e1c
commit b95cd9a02a

View File

@@ -1697,6 +1697,15 @@ async function main(): Promise<void> {
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(