feat: memory filesystem sync (#905)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2026-02-10 18:06:05 -08:00
committed by GitHub
parent eaa813ddb9
commit d1a6eeb40a
13 changed files with 1085 additions and 3079 deletions

View File

@@ -7,6 +7,7 @@
import { createRequire } from "node:module";
import * as path from "node:path";
import { fileURLToPath } from "node:url";
import { getServerUrl } from "../../agent/client";
import { getCurrentAgentId } from "../../agent/context";
import { settingsManager } from "../../settings-manager";
@@ -68,13 +69,16 @@ export function getShellEnv(): NodeJS.ProcessEnv {
// Context not set yet (e.g., during startup), skip
}
// Inject API key from settings if not already in env
if (!env.LETTA_API_KEY) {
// Inject API key and base URL from settings if not already in env
if (!env.LETTA_API_KEY || !env.LETTA_BASE_URL) {
try {
const settings = settingsManager.getSettings();
if (settings.env?.LETTA_API_KEY) {
if (!env.LETTA_API_KEY && settings.env?.LETTA_API_KEY) {
env.LETTA_API_KEY = settings.env.LETTA_API_KEY;
}
if (!env.LETTA_BASE_URL) {
env.LETTA_BASE_URL = getServerUrl();
}
} catch {
// Settings not initialized yet, skip
}