diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.ts index 5fe2ea19f3..b8548346d5 100644 --- a/autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.ts +++ b/autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.ts @@ -355,6 +355,12 @@ export function useCopilotPage() { } function handleSelectSession(id: string) { + // Record current session's mode before switching away so it's + // preserved when the user switches back — covers sessions created + // before the per-session mode fix was deployed. + if (sessionId) { + recordSessionMode(sessionId); + } setSessionId(id); restoreSessionMode(id); if (isMobile) setDrawerOpen(false);