fix(cli): resolve global LRU agent on directory switch instead of cre… (#951)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2026-02-13 23:02:38 -08:00
committed by GitHub
parent 652628083d
commit e337330dbe
9 changed files with 747 additions and 70 deletions

View File

@@ -215,3 +215,21 @@ export async function applyMemfsFlags(
pullSummary,
};
}
/**
* Enable memfs for a newly created agent if on Letta Cloud.
* Non-fatal: logs a warning on failure. Skips on self-hosted.
*/
export async function enableMemfsIfCloud(agentId: string): Promise<void> {
const { getServerUrl } = await import("./client");
const serverUrl = getServerUrl();
if (!serverUrl.includes("api.letta.com")) return;
try {
await applyMemfsFlags(agentId, true, undefined);
} catch (error) {
console.warn(
`Warning: Could not enable memfs for new agent: ${error instanceof Error ? error.message : String(error)}`,
);
}
}