feat: add tags to headless (#957)

This commit is contained in:
Christina Tong
2026-02-13 19:45:40 -08:00
committed by GitHub
parent 81ac1670ab
commit b90e0b9db5
3 changed files with 9 additions and 0 deletions

View File

@@ -73,6 +73,8 @@ export interface CreateAgentOptions {
>;
/** Override values for preset blocks (label → value) */
blockValues?: Record<string, string>;
/** Tags to organize and categorize the agent */
tags?: string[];
}
export async function createAgent(
@@ -290,6 +292,9 @@ export async function createAgent(
if (isSubagent) {
tags.push("role:subagent");
}
if (options.tags && Array.isArray(options.tags)) {
tags.push(...options.tags);
}
const agentDescription =
options.description ?? `Letta Code agent created in ${process.cwd()}`;

View File

@@ -124,6 +124,7 @@ export async function handleHeadlessCommand(
"init-blocks": { type: "string" },
"base-tools": { type: "string" },
"from-af": { type: "string" },
tags: { type: "string" },
memfs: { type: "boolean" },
"no-memfs": { type: "boolean" },
@@ -268,6 +269,7 @@ export async function handleHeadlessCommand(
const fromAfFile = values["from-af"] as string | undefined;
const preLoadSkillsRaw = values["pre-load-skills"] as string | undefined;
const maxTurnsRaw = values["max-turns"] as string | undefined;
const tags = values["tags"] as string[] | undefined;
// Parse and validate max-turns if provided
let maxTurns: number | undefined;
@@ -581,6 +583,7 @@ export async function handleHeadlessCommand(
baseTools,
memoryBlocks,
blockValues,
tags,
};
const result = await createAgent(createOptions);
agent = result.agent;

View File

@@ -439,6 +439,7 @@ async function main(): Promise<void> {
"pre-load-skills": { type: "string" },
"from-af": { type: "string" },
import: { type: "string" },
tags: { type: "string" },
memfs: { type: "boolean" },
"no-memfs": { type: "boolean" },