mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
fix: resolve pinned Telegram sessions into sidebar Pinned section
The sessionByAnyId map only indexed cronSessions and visibleSessions (local CLI chats), so a pinned gateway session (Telegram, etc.) stored its pinId in localStorage but could never be resolved back to a SessionInfo object — the Pinned section rendered empty for those. Include messagingSessions in the lookup so pinned gateway chats appear correctly at the top of the sidebar.
This commit is contained in:
parent
5081551f09
commit
ab694586b2
1 changed files with 3 additions and 1 deletions
|
|
@ -395,13 +395,15 @@ export function ChatSidebar({
|
|||
|
||||
// Index sessions by both their live id and their lineage-root id so a pin
|
||||
// stored as the pre-compression root resolves to the live continuation tip.
|
||||
// Include messaging sessions (Telegram, etc.) so pinned gateway chats also
|
||||
// resolve into the Pinned section.
|
||||
const sessionByAnyId = useMemo(() => {
|
||||
const map = new Map<string, SessionInfo>()
|
||||
|
||||
// Cron sessions are listed separately but can still be pinned, so index
|
||||
// them too — otherwise a pinned cron job can't resolve into the Pinned
|
||||
// section. Recents take precedence on id collisions (set last).
|
||||
for (const s of [...cronSessions, ...visibleSessions]) {
|
||||
for (const s of [...cronSessions, ...messagingSessions, ...visibleSessions]) {
|
||||
map.set(s.id, s)
|
||||
|
||||
if (s._lineage_root_id && !map.has(s._lineage_root_id)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue