From 1c8b5847f7b10dd5519770dfdce18eb1541e104f Mon Sep 17 00:00:00 2001 From: Jason Mulligan Date: Wed, 12 Aug 2026 16:39:30 -0400 Subject: [PATCH] fix: persist session before switching to new session --- src/tui/app.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tui/app.js b/src/tui/app.js index 24be7c69..76503875 100644 --- a/src/tui/app.js +++ b/src/tui/app.js @@ -589,7 +589,11 @@ export default function App({ /** * Start a new session: generate new UUID, clear conversation, reset state. */ - const handleNewSession = () => { + const handleNewSession = async () => { + // Persist the current session before wiping state + if (onSaveSession) { + await onSaveSession(); + } const newSession = createSession({ provider: sessionState.getProvider() }); sessionState.createNewSession(newSession.sessionId); setIsCompacting(false);