From ead65ff1e78cff0679ce410c4f2405d157c2b08e Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 6 Mar 2026 12:04:05 -0800 Subject: [PATCH] fix: restore public store and invalidateSession on LettaBot (#515) --- src/core/bot.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/core/bot.ts b/src/core/bot.ts index 05c17a0..85abf09 100644 --- a/src/core/bot.ts +++ b/src/core/bot.ts @@ -187,7 +187,7 @@ export function resolveHeartbeatConversationKey( } export class LettaBot implements AgentSession { - private store: Store; + readonly store: Store; private config: BotConfig; private channels: Map = new Map(); private messageQueue: Array<{ msg: InboundMessage; adapter: ChannelAdapter }> = []; @@ -485,6 +485,14 @@ export class LettaBot implements AgentSession { return this.sessionManager.warmSession(); } + /** + * Invalidate cached session(s), forcing a fresh session on next message. + * The next message will create a fresh session using the current store state. + */ + invalidateSession(key?: string): void { + this.sessionManager.invalidateSession(key); + } + // ========================================================================= // Channel management // =========================================================================