Skip to content

[Bug]: Project<->session association lost — chats disappear from PROJECTS sidebar but remain in global sessions #65004

Description

@bgexpert

Description

In Hermes Desktop, chats that were created inside a project (sidebar: PROJECTS → project expanded shows nested chat sub-items) lose their association with the project over time. The project entry remains in the sidebar and is expandable (caret points up), but the nested chat list becomes empty, while the same chats are still present and openable in the global session list (Search sessions... / all-sessions view).

This has happened repeatedly and is not limited to one project — observed across multiple projects (e.g. a bistånd project showed zero nested chats while those sessions were clearly alive in the general session list). The associations were present originally, then vanished.

Root cause (hypothesis)

The project↔session link is stored in the project/state metadata, but something breaks that link during normal use. Candidate triggers:

  • Session switch / project switch races writing the association map.
  • A project state write that omits the sessions array (or writes null) when the project metadata is re-saved.
  • Orphaned sessions: a session file exists but its back-reference to the project is dropped.

This is a session-state integrity bug (adjacent to the composer draft bug in #63210 and the sweeper:risk-session-state class).

Steps to reproduce

  1. Create a project (or use an existing one) and start several chats inside it.
  2. Confirm the chats appear as nested sub-items under the project in the PROJECTS sidebar.
  3. Use the app over time — switch between projects/sessions, close/reopen, let sessions accumulate.
  4. Return to the PROJECTS sidebar and expand the project.
  5. Observe: the nested chat list is empty, although the sessions still exist in the global session list.

Expected

A project's nested chat list should always reflect the sessions that belong to it, persistently, until explicitly removed.

Environment

  • OS: Windows 10 64-bit
  • Hermes: 0.18.2 (win-unpacked)
  • Reproduces across multiple projects, intermittently but consistently over time.

Possible fix direction

On project metadata save, never drop the sessions array; reconcile orphaned sessions by re-linking any session whose project back-reference matches but whose forward link is missing. Add an integrity check / repair on sidebar load.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havearea/sessionsSession lifecycle, resume, persistence, historycomp/desktopElectron desktop app (apps/desktop/*)sweeper:risk-session-stateSweeper risk: may lose/corrupt/mis-associate session or context statetype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions