From 9fcc332a99095a2b5635eb786ea02ca73311803a Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Wed, 14 Jan 2026 19:44:04 +0530 Subject: [PATCH] fix: prevent waiting for the session to load from history --- gui/src/redux/thunks/session.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/gui/src/redux/thunks/session.ts b/gui/src/redux/thunks/session.ts index 03a94fa7a..8912fd330 100644 --- a/gui/src/redux/thunks/session.ts +++ b/gui/src/redux/thunks/session.ts @@ -105,25 +105,25 @@ export const loadSession = createAsyncThunk< ThunkApiType >( "session/load", - async ( - { sessionId, saveCurrentSession: save }, - { extra, dispatch, getState }, - ) => { + async ({ sessionId, saveCurrentSession: save }, { extra, dispatch }) => { if (save) { - const result = await dispatch( - saveCurrentSession({ - openNewSession: false, - generateTitle: true, - }), - ); - unwrapResult(result); + // save the session in the background + void (async () => { + const result = await dispatch( + saveCurrentSession({ + openNewSession: false, + generateTitle: true, + }), + ); + unwrapResult(result); + })(); } const session = await getSession(extra.ideMessenger, sessionId); dispatch(newSession(session)); // Restore selected chat model from session, if present if (session.chatModelTitle) { - dispatch(selectChatModelForProfile(session.chatModelTitle)); + void dispatch(selectChatModelForProfile(session.chatModelTitle)); } }, );