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 <noreply@letta.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user