Skip to content

fix(desktop): bot navigation no longer forces the all-profiles sidebar on - #89031

Closed
marketing2981 wants to merge 1 commit into
NousResearch:mainfrom
marketing2981:fix/bot-click-resets-profile-filter
Closed

fix(desktop): bot navigation no longer forces the all-profiles sidebar on#89031
marketing2981 wants to merge 1 commit into
NousResearch:mainfrom
marketing2981:fix/bot-click-resets-profile-filter

Conversation

@marketing2981

Copy link
Copy Markdown
Contributor

Problem

With more than one profile, the Sessions sidebar profile filter cannot be kept: narrowing Sessions to a single profile works, but clicking any other bot re-enables the unified all-profiles list.

Clicking the same bot again is fine — no profile change, so nothing resets. That asymmetry makes it read as flaky UI rather than a bug.

Cause

sdk/index.ts turns the all-profiles view back on whenever openSession crosses a profile boundary, unless the caller opts out:

if (profile && profile !== $activeGatewayProfile.get()) {
  await ensureGatewayProfile(profile)

  if (options.keepAllProfilesScope !== false) {
    setShowAllProfiles(true)   // ← default path
  }
}

The Bot Mode plugin never passes keepAllProfilesScope, so all seven of its host.openSession calls take that default.

That default is right for its original caller — the all-profiles browse list, where switching scope would throw away the view the user is in. It is wrong for bot navigation, which is an explicit context switch into that bot's profile: the user is leaving the unified view, not browsing it.

Fix

Pass keepAllProfilesScope: false at all seven call sites — canonical chat open, adopt, pinned/preferred, recovery, and the Sessions workspace row.

No new API: the option already exists and is documented in the SDK; the plugin simply was not using it.

Testing

  • node --test apps/desktop/src/plugins/hermes-bots/tests/*.test.mjs254 passing
  • session-workspace.test.mjs asserts the exact options object, so its expectation is updated in the same commit.

Reproduction

  1. Have ≥2 profiles.
  2. Sidebar → filter menu → narrow Sessions to one profile.
  3. Click a different bot in the Bots panel.

Before: the filter is discarded and every profile's sessions return.
After: the filter holds; the sidebar follows the profile you switched into.

Notes

Found while running six profiles (one bot per brand). The profile count only changes how often it fires — two profiles are enough to reproduce.

…r 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:

```ts
// sdk/index.ts
if (profile && profile !== $activeGatewayProfile.get()) {
  await ensureGatewayProfile(profile)
  if (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. Re-tapping the *same* bot was
fine (no profile change, no reset), which made the behaviour look random
rather than like a bug.

Bot navigation is an explicit context switch into that bot's profile —
the opposite of the browse view `keepAllProfilesScope` exists to protect
— so pass `false` at all seven call sites (canonical chat open/adopt/
recovery paths and the Sessions workspace row).

`session-workspace.test.mjs` asserts the exact options object, so it is
updated alongside. Full plugin suite: 254 passing.
@alt-glitch alt-glitch added type/bug Something isn't working comp/desktop Electron desktop app (apps/desktop/*) area/sessions Session lifecycle, resume, persistence, history area/profiles Multi-profile isolation, HERMES_HOME scoping P3 Low — cosmetic, nice to have labels Aug 18, 2026
teknium1 pushed a commit that referenced this pull request Aug 19, 2026
…r 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.
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #89722 (#89722) with your authorship preserved. plugin.js had been refactored since your branch (7 openSession sites became 4), so we re-applied your keepAllProfilesScope: false intent to all current call sites. Thanks for the clear root-cause analysis!

@teknium1 teknium1 closed this Aug 19, 2026
lisajlau pushed a commit to lisajlau/hermes-agent that referenced this pull request Aug 20, 2026
…r 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 NousResearch#89031 onto current main; includes contributor mapping.
lisajlau pushed a commit to lisajlau/hermes-agent that referenced this pull request Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/profiles Multi-profile isolation, HERMES_HOME scoping area/sessions Session lifecycle, resume, persistence, history comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants