fix(desktop): scope sessions to selected profile - #70630
Conversation
Related: #42934 and #63618 address the active-profile Messaging sidebar path. This PR also changes the backend slices, remote Electron routing, search, pins, pagination, and stale-response handling, so it is broader rather than a duplicate. Please choose whether to consolidate the overlapping profile-scope work. |
|
Really nice to see the sidebar scoping pulled together here — routing While you're in this fan-out, one small heads-up you might want to fold in, since it sits a little below your changes in the same intercept. There's an adjacent one, #67600 (P2): the On current
Since this PR reworks the slice params but (reasonably) leaves those dispatch lines alone, that case would still reproduce after it merges. If it's helpful, the fix is small and complements what you have: send the batched slices through One clarification on that swap, since the natural concern would be regressing token-auth setups: Thanks again for consolidating all of this. |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for consolidating the selected-profile sidebar boundary. The underlying bug is still present on current main: hermes_cli/web_routers/profiles.py:290-303 scopes recents but appends cron and Messaging rows for every profile, while use-session-list-actions.ts:84-121 also refreshes/pages Messaging with profile='all'.
Problems
- The backend hunk targets the pre-extraction
hermes_cli/web_server.py; current main moved this route tohermes_cli/web_routers/profiles.py:195in27b1377b4c5284d0fc16ed5df4c27c507b86559d. The scope condition needs to be applied at the current loop. - Current main already has
apps/desktop/src/app/chat/sidebar/session-index.ts:17for pin resolution. Addingsession-pin-index.tswould duplicate the same ID/lineage indexing policy.
Suggested changes
- Salvage the scope boundary across the current router, compatibility fallback, and Electron slice fan-out.
- Extend the existing session index rather than adding a parallel helper.
- Preserve the current OAuth-aware primary routing introduced by
704a32187030146d83fcfa323c62bcd60c32e126, which addresses the adjacent concern raised in the PR discussion.
Automated hermes-sweeper review.
| import { normalizeProfileKey } from '@/store/profile' | ||
|
|
||
| export function buildPinnedSessionIndex( | ||
| profileScope: string, |
There was a problem hiding this comment.
Current main already has session-index.ts:17 for the same live-ID and lineage-root pin resolution policy. During salvage, extend that helper or pass it scoped arrays rather than adding a second index implementation that can drift.
|
Fresh confirmation against current main |
|
Closing this in favor of #83052, which merged the later integrated sidebar/profile implementation and explicitly closed #70629. #83052 carries the final implementation and authorship from @OutThisLife. It scopes cron and Messaging to the selected concrete profile or explicit This PR remains useful as prior diagnosis and regression material, but it is no longer the merge vehicle. Thanks to everyone who reviewed and consolidated the work. |
What does this PR do?
Makes the Hermes Desktop profile rail a consistent session-sidebar workspace boundary.
Concrete profiles now receive only their own recents, cron sessions, Messaging sessions, pagination state, and pins. Cross-profile aggregation remains available only through the explicit
All Profilesscope. The same invariant is enforced by the batched backend endpoint, the legacy fallback, and the Electron remote-backend splice.Related Issue
Fixes #70629
Type of Change
Changes Made
hermes_cli/web_server.py.response to the scope that produced it.
No session database, profile config, credential, migration, or gateway behavior is changed.
How to Test
/api/profiles/sessions/sidebar.All Profilesand verify that rows aggregate with profile provenance.the old response is ignored.
Automated proof
2 passedbackend endpoint tests.105 passedfocused Desktop/Electron tests.typecheckpassed.Checklist
Code
Documentation & Housekeeping