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.
This commit is contained in:
Ani Tunturi
2026-03-20 18:33:40 -04:00
committed by Ani
parent 238dd6c831
commit 74e6c764d3
2 changed files with 4 additions and 3 deletions

View File

@@ -348,7 +348,7 @@ export async function applyMemfsFlags(
agentId, agentId,
options?.agentTags ? { tags: options.agentTags } : undefined, options?.agentTags ? { tags: options.agentTags } : undefined,
); );
if (!isGitRepo(agentId)) { if (!isGitRepo(agentId) && (await isLettaCloud())) {
await cloneMemoryRepo(agentId); await cloneMemoryRepo(agentId);
} else if (options?.pullOnExistingRepo) { } else if (options?.pullOnExistingRepo) {
const result = await pullMemory(agentId); const result = await pullMemory(agentId);

View File

@@ -51,6 +51,7 @@ import { ISOLATED_BLOCK_LABELS } from "../agent/memory";
import { import {
ensureMemoryFilesystemDirs, ensureMemoryFilesystemDirs,
getMemoryFilesystemRoot, getMemoryFilesystemRoot,
isLettaCloud,
} from "../agent/memoryFilesystem"; } from "../agent/memoryFilesystem";
import { import {
getStreamToolContextId, getStreamToolContextId,
@@ -3643,9 +3644,9 @@ export default function App({
const { isGitRepo, cloneMemoryRepo, pullMemory } = await import( const { isGitRepo, cloneMemoryRepo, pullMemory } = await import(
"../agent/memoryGit" "../agent/memoryGit"
); );
if (!isGitRepo(agentId)) { if (!isGitRepo(agentId) && (await isLettaCloud())) {
await cloneMemoryRepo(agentId); await cloneMemoryRepo(agentId);
} else { } else if (isGitRepo(agentId)) {
await pullMemory(agentId); await pullMemory(agentId);
} }
} catch (err) { } catch (err) {