Skip to content

session_search with profile= parameter returns sessions from wrong profile (cross-contamination) #65133

Description

@brunocosta77

Bug Description

When calling session_search(profile="novel"), it returns sessions
from the blog-writer profile instead of the novel profile's own
sessions. Both profiles have their own state.db databases with
correct session data, but the session_search tool appears to be
resolving the wrong database path when a profile name is passed.

Environment

  • OS: Windows 10
  • Hermes version: 0.18.2 (appeared after auto-update to 0.18.x)
  • Profiles affected: at least two (novel, blog-writer)
  • Installation: Native desktop app (Electron)

Steps to Reproduce

  1. Have two profiles with session history
  2. Switch to profile A (e.g. blog-writer)
  3. session_search() → correctly returns A's sessions
  4. session_search(profile="B") → returns A's sessions instead of B's

Expected Behavior

session_search(profile="novel") should return 10 sessions from
profiles/novel/state.db.

Actual Behavior

Returns current profile's sessions, ignoring the profile parameter.
profiles/novel/state.db exists with 10 sessions / 377 messages
intact — data verified via direct SQLite queries.

Notes

  • Pre-update snapshot created automatically (data safety net worked)
  • state.db files not corrupted
  • The profile parameter appears resolved to current profile's path
    instead of the requested one

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existsarea/profilesMulti-profile isolation, HERMES_HOME scopingarea/sessionsSession lifecycle, resume, persistence, historycomp/agentCore agent runtime: loop, agent_init, prompt builder, context-compression, responses endpointduplicateThis issue or pull request already existssweeper: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