feat: memory filesystem sync (#905)
Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user