From 74e6c764d3da581012969d4f40afb67859f25255 Mon Sep 17 00:00:00 2001 From: Ani Tunturi Date: Fri, 20 Mar 2026 18:33:40 -0400 Subject: [PATCH] fix: skip memfs git sync on self-hosted servers (temporary) Self-hosted Letta servers lack the /v1/git/ endpoint, causing 501 errors on cloneMemoryRepo() and pullMemory() calls. This is a temporary guard using isLettaCloud() to skip git-backed memory sync when not connected to Letta Cloud. TODO: Replace with a proper self-hosted server configuration option (e.g. server capability discovery or a memfs storage backend flag) so self-hosted users can opt into local git-backed memory without requiring the Cloud /v1/git/ endpoint. --- src/agent/memoryFilesystem.ts | 2 +- src/cli/App.tsx | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/agent/memoryFilesystem.ts b/src/agent/memoryFilesystem.ts index ba2123d..462a33a 100644 --- a/src/agent/memoryFilesystem.ts +++ b/src/agent/memoryFilesystem.ts @@ -348,7 +348,7 @@ export async function applyMemfsFlags( agentId, options?.agentTags ? { tags: options.agentTags } : undefined, ); - if (!isGitRepo(agentId)) { + if (!isGitRepo(agentId) && (await isLettaCloud())) { await cloneMemoryRepo(agentId); } else if (options?.pullOnExistingRepo) { const result = await pullMemory(agentId); diff --git a/src/cli/App.tsx b/src/cli/App.tsx index 57f913b..016dcbe 100644 --- a/src/cli/App.tsx +++ b/src/cli/App.tsx @@ -51,6 +51,7 @@ import { ISOLATED_BLOCK_LABELS } from "../agent/memory"; import { ensureMemoryFilesystemDirs, getMemoryFilesystemRoot, + isLettaCloud, } from "../agent/memoryFilesystem"; import { getStreamToolContextId, @@ -3643,9 +3644,9 @@ export default function App({ const { isGitRepo, cloneMemoryRepo, pullMemory } = await import( "../agent/memoryGit" ); - if (!isGitRepo(agentId)) { + if (!isGitRepo(agentId) && (await isLettaCloud())) { await cloneMemoryRepo(agentId); - } else { + } else if (isGitRepo(agentId)) { await pullMemory(agentId); } } catch (err) {