fix: make --new-agent use default conversation (#595)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2026-01-19 13:33:00 -08:00
committed by GitHub
parent a526614e28
commit 03a2cfc2ed
4 changed files with 40 additions and 18 deletions

View File

@@ -641,16 +641,15 @@ export async function handleHeadlessCommand(
);
process.exit(1);
}
} else if (forceNewConversation || forceNew) {
// --new flag (new conversation) or --new-agent (new agent): create a new conversation
// When creating a new agent, always create a new conversation alongside it
} else if (forceNewConversation) {
// --new flag: create a new conversation (for concurrent sessions)
const conversation = await client.conversations.create({
agent_id: agent.id,
isolated_block_labels: isolatedBlockLabels,
});
conversationId = conversation.id;
} else {
// Default: use the agent's "default" conversation (OG single-threaded behavior)
// Default (including --new-agent, --agent): use the agent's "default" conversation
conversationId = "default";
}
markMilestone("HEADLESS_CONVERSATION_READY");