From d52ea4e8553dc5a6c4f4062fe76a288b7ed4f3f4 Mon Sep 17 00:00:00 2001 From: Ari Webb Date: Tue, 10 Feb 2026 10:29:06 -0800 Subject: [PATCH] fix: create new conversation when no stored conversation ID exists (#245) (#250) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When an agent ID is configured but no conversation ID is stored, LettaBot previously tried to resume the agent's default conversation via resumeSession(). If that default conversation was deleted or never created (e.g., after migrations), the CLI exited with "Conversation default not found" and the bot never replied to messages. The fix changes getSession() to call createSession() instead of resumeSession() when there's no stored conversation ID, ensuring a new conversation is always created in this case. 👾 Generated with [Letta Code](https://letta.com) Co-authored-by: Letta --- src/core/bot.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/bot.ts b/src/core/bot.ts index daf2d91..b80fb78 100644 --- a/src/core/bot.ts +++ b/src/core/bot.ts @@ -199,7 +199,10 @@ export class LettaBot implements AgentSession { } if (this.store.agentId) { process.env.LETTA_AGENT_ID = this.store.agentId; - return resumeSession(this.store.agentId, opts); + // Create a new conversation instead of resuming the default. + // This handles the case where the default conversation was deleted + // or never created (e.g., after migrations). + return createSession(this.store.agentId, opts); } // Create new agent -- persist immediately so we don't orphan it on later failures