hermes - 💡(How to fix) Fix Agents lose project context across session restarts — hallucinate wrong project identity

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

Root Cause Analysis

Fix Action

Fix / Workaround

Short-term (documentation/workaround)

  1. Document that agents should call session_search at session start to recover context
  2. Add a CLAUDE.md pattern for project-scoped context that loads on session start
RAW_BUFFERClick to expand / collapse

Problem

When a Telegram topic's agent session restarts (timeout, gateway restart, or new conversation), the agent loses all knowledge of what project it was working on and what the conversation was about. Worse, the agent sometimes believes it is working on a completely different project or confuses sessions, leading to incorrect file deliveries, wrong codebase references, and hallucinated context.

Reproduction

  1. Work on Project A in Telegram topic T1 (session S1 active)
  2. Session S1 expires or gateway restarts
  3. Send a new message in topic T1
  4. Agent has no context about Project A, may:
    • Ask what project this is about
    • Reference files/code from Project B (last active session)
    • Deliver files intended for topic T1 to a different topic or DM
    • Hallucinate context from unrelated sessions

Root Cause Analysis

1. Sessions are fully isolated per chat/thread

Each Telegram topic maps to a separate agent session in ~/.hermes/sessions/. Sessions store:

  • Conversation history
  • Tool call results
  • Working directory state

But when a session expires or restarts:

  • No automatic cross-session context lookup — the agent doesn't call session_search to find relevant past work
  • No session-to-project mapping — there's no persistent mapping like "topic T1 → Project A"

2. Memory system is intentionally limited for temporary context

The memory system (~3,500 chars total) is designed for:

  • User identity and preferences
  • Environment facts (OS, tools, paths)
  • Tool quirks and conventions

It explicitly excludes:

  • Task progress
  • "Currently working on project X"
  • PR numbers, commit SHAs, temporary state

This means there's no persistent mechanism to store "this topic is about Project A" that survives session restarts.

3. No session metadata tagging

Sessions don't have tags, labels, or project associations. hermes sessions list shows sessions by timestamp/ID only. There's no way to:

  • Tag a session with a project name
  • Filter sessions by project
  • Auto-resume the correct session for a topic

4. File delivery routing uses active session context

When the agent is asked to deliver a file:

  • It uses send_message() with the target from its current session context
  • If the session has wrong/stale context, it delivers to the wrong location
  • There's no validation that the target matches the user's current topic

Proposed Solutions

Short-term (documentation/workaround)

  1. Document that agents should call session_search at session start to recover context
  2. Add a CLAUDE.md pattern for project-scoped context that loads on session start

Medium-term (code changes)

  1. Session metadata — Add project/topic tags to sessions that persist across restarts
  2. Auto session_search — Have the agent automatically search past sessions when context is unclear
  3. Topic-to-project mapping — Store a mapping of Telegram topic → project in config
  4. Delivery validation — When send_message is called, validate the target against the user's current topic

Long-term (architecture)

  1. Shared context layer — A cross-session context store that persists project state independent of individual sessions
  2. Session resume hints — When a new session starts in a known topic, automatically load relevant past session context

Environment

  • Hermes Agent version: current (as of May 2026)
  • Platform: Telegram gateway with forum topics
  • Memory: enabled (built-in provider)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix Agents lose project context across session restarts — hallucinate wrong project identity