fix(panels): apply profile default workspace to new session after profile switch (fixes #424)

This commit is contained in:
Hermes Agent
2026-04-14 19:06:37 +00:00
parent b3ad60d2c9
commit 77769750c2

View File

@@ -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 {