From ed47d41dc95d5f7cfdeba185b0f500b360330fe5 Mon Sep 17 00:00:00 2001 From: marketing2981 Date: Tue, 18 Aug 2026 21:15:35 -0700 Subject: [PATCH] fix(desktop): bot navigation no longer forces the all-profiles sidebar on Every host.openSession call in the Bot Mode plugin omitted keepAllProfilesScope, so the SDK applied its default and flipped $showAllProfiles back on whenever the target session belonged to a different profile than the live gateway (sdk/index.ts: options.keepAllProfilesScope !== false => setShowAllProfiles(true)). For anyone running more than one profile this silently undid the sidebar profile filter: narrow Sessions to one profile, click any other bot, and the unified all-profiles list came back. Bot navigation is an explicit context switch into that bot's profile, so pass keepAllProfilesScope: false at every openSession call site (4 on current main after the plugin.js refactor consolidated the original 7). Salvaged from PR #89031 onto current main; includes contributor mapping. --- apps/desktop/src/plugins/hermes-bots/plugin.js | 9 +++++---- .../plugins/hermes-bots/tests/session-workspace.test.mjs | 4 ++-- contributors/emails/marketing@cflow.co.kr | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 contributors/emails/marketing@cflow.co.kr diff --git a/apps/desktop/src/plugins/hermes-bots/plugin.js b/apps/desktop/src/plugins/hermes-bots/plugin.js index c4601b5fd7..2f1a4917cf 100644 --- a/apps/desktop/src/plugins/hermes-bots/plugin.js +++ b/apps/desktop/src/plugins/hermes-bots/plugin.js @@ -3190,7 +3190,8 @@ async function openStoredBotChat(name, storedId, summary) { profile: name, intent: 'main', awaitHydration: true, - expectHistory + expectHistory, + keepAllProfilesScope: false }) return storedId @@ -3230,7 +3231,7 @@ function createCanonicalChat(name) { if (sid && typeof host.openSession === 'function') { try { - await host.openSession(sid, { profile: name, intent: 'main' }) + await host.openSession(sid, { profile: name, intent: 'main', keepAllProfilesScope: false }) opened = true } catch { // The stored row may not exist until the kickoff persists it. Retry @@ -3245,7 +3246,7 @@ function createCanonicalChat(name) { await host.request('prompt.submit', { session_id: runtime, text: 'Hey, tell me about yourself!' }) if (!opened && sid && typeof host.openSession === 'function') { - await host.openSession(sid, { profile: name, intent: 'main' }) + await host.openSession(sid, { profile: name, intent: 'main', keepAllProfilesScope: false }) } } catch { // The chat already exists. Keep the pin so the next click @@ -7686,7 +7687,7 @@ async function openProfileSession(botName, session, gatewayGeneration) { typeof session?.message_count === 'number' && Number.isFinite(session.message_count) const expectHistory = hasAuthoritativeCount ? session.message_count > 0 : Boolean(session?.preview) - await host.openSession(id, { profile, awaitHydration: true, expectHistory }) + await host.openSession(id, { profile, awaitHydration: true, expectHistory, keepAllProfilesScope: false }) if (gatewayGeneration !== $sessionsGatewayGeneration.get()) return $botSelectedSessions.set({ ...$botSelectedSessions.get(), [profile]: id }) } diff --git a/apps/desktop/src/plugins/hermes-bots/tests/session-workspace.test.mjs b/apps/desktop/src/plugins/hermes-bots/tests/session-workspace.test.mjs index 8d2d1c03b8..e209eebc15 100644 --- a/apps/desktop/src/plugins/hermes-bots/tests/session-workspace.test.mjs +++ b/apps/desktop/src/plugins/hermes-bots/tests/session-workspace.test.mjs @@ -90,7 +90,7 @@ test('sessions workspace: opening a stored row uses profile-aware navigation and const runtime = load({ profile: 'default' }) await runtime.__sessions.openProfileSession('ops', { id: 'stored-123', message_count: 4 }, 0) assert.deepEqual(plain(runtime.calls), [ - ['openSession', 'stored-123', { profile: 'ops', awaitHydration: true, expectHistory: true }] + ['openSession', 'stored-123', { profile: 'ops', awaitHydration: true, expectHistory: true, keepAllProfilesScope: false }] ]) assert.equal(runtime.__sessions.$botSelectedSessions.get().ops, 'stored-123') }) @@ -117,7 +117,7 @@ test('sessions workspace: an empty session with no preview does not demand histo const runtime = load() await runtime.__sessions.openProfileSession('ops', { id: 'stored-empty', message_count: 0 }, 0) assert.deepEqual(plain(runtime.calls), [ - ['openSession', 'stored-empty', { profile: 'ops', awaitHydration: true, expectHistory: false }] + ['openSession', 'stored-empty', { profile: 'ops', awaitHydration: true, expectHistory: false, keepAllProfilesScope: false }] ]) }) diff --git a/contributors/emails/marketing@cflow.co.kr b/contributors/emails/marketing@cflow.co.kr new file mode 100644 index 0000000000..53eb678ad5 --- /dev/null +++ b/contributors/emails/marketing@cflow.co.kr @@ -0,0 +1 @@ +marketing2981