From 77769750c2361774266af3724a4a19d33f29d0e4 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Tue, 14 Apr 2026 19:06:37 +0000 Subject: [PATCH] fix(panels): apply profile default workspace to new session after profile switch (fixes #424) --- static/panels.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/static/panels.js b/static/panels.js index 520cfc8..237ab65 100644 --- a/static/panels.js +++ b/static/panels.js @@ -947,6 +947,18 @@ async function switchToProfile(name) { // The current session has messages and belongs to the previous profile. // Start a new session for the new profile so nothing gets cross-tagged. await newSession(false); + // Apply profile default workspace to the newly created session (fixes #424) + if (S._profileDefaultWorkspace && S.session) { + try { + await api('/api/session/update', { method: 'POST', body: JSON.stringify({ + session_id: S.session.session_id, + workspace: S._profileDefaultWorkspace, + model: S.session.model, + })}); + S.session.workspace = S._profileDefaultWorkspace; + } catch (_) {} + } + updateWorkspaceChip(); await renderSessionList(); showToast(t('profile_switched_new_conversation', name)); } else {