chore: Add --system flag for existing agents + update system prompt variable names (#328)

This commit is contained in:
Devansh Jain
2025-12-19 17:16:21 -08:00
committed by GitHub
parent f9bffaed81
commit 7d73219c50
6 changed files with 127 additions and 59 deletions

View File

@@ -53,7 +53,7 @@ export async function createAgent(
skillsDirectory?: string,
parallelToolCalls = true,
enableSleeptime = false,
systemPrompt?: string,
systemPromptId?: string,
initBlocks?: string[],
baseTools?: string[],
) {
@@ -202,13 +202,13 @@ export async function createAgent(
const modelUpdateArgs = getModelUpdateArgs(modelHandle);
const contextWindow = (modelUpdateArgs?.context_window as number) || 200_000;
// Resolve system prompt (ID, subagent name, or literal content)
const resolvedSystemPrompt = await resolveSystemPrompt(systemPrompt);
// Resolve system prompt ID to content
const systemPromptContent = await resolveSystemPrompt(systemPromptId);
// Create agent with all block IDs (existing + newly created)
const agent = await client.agents.create({
agent_type: "letta_v1_agent" as AgentType,
system: resolvedSystemPrompt,
system: systemPromptContent,
name,
description: `Letta Code agent created in ${process.cwd()}`,
embedding: embeddingModel,