hermes - ✅(Solved) Fix Goals lost when session ends — design contradicts 'persistent across sessions' intent [1 pull requests, 2 comments, 2 participants]

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…
GitHub stats
NousResearch/hermes-agent#19077Fetched 2026-05-04 05:18:13
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×3commented ×2cross-referenced ×1

Root Cause

In hermes_state.py, goals are stored with session-specific keys:

# Goal key pattern
key = f"goal:{session_id}"

There is no separate goal registry or cross-session index.

Fix Action

Fixed

PR fix notes

PR #19125: fix(goals): store goals under session-independent key to survive session boundaries

Description (problem / solution / changelog)

Summary

Fixes #19077

Goals created via /goal were stored with key goal:<session_id> in the state_meta table, binding them to the session lifecycle. When a session ended, the goal data became inaccessible from new sessions.

Changes

  • Switch to a session-independent global key (goal:global) so goals survive session boundaries
  • The legacy goal:<session_id> key is tried as a fallback in load_goal() for backwards compatibility with pre-existing goals
  • Updated module docstring to reflect the new key scheme

Changed files

  • hermes_cli/goals.py (modified, +21/-5)

Code Example

# Goal key pattern
key = f"goal:{session_id}"
RAW_BUFFERClick to expand / collapse

Bug Description

Goals created via /goal are stored with goal:<session_id> as the key in state_meta table, binding them to the session lifecycle. When a session ends or gets pruned, the goal data is deleted along with it.

This contradicts the documented intent in the codebase:

"Persistent goal tracking across sessions" "Goals survive session boundaries"

Steps to Reproduce

  1. Start a Telegram session with Hermes
  2. Create a goal: /goal Configure OpenClaw on Mac Mini
  3. Add tasks to the goal
  4. Close the Telegram session (or wait for it to be pruned)
  5. Start a new Telegram session
  6. Try /goal list — no goals shown
  7. Check state_meta table — goal data is gone

Expected Behavior

  • Goals should persist across sessions
  • /goal list should show all active goals regardless of which session created them
  • Goals should have their own lifecycle, independent of sessions

Actual Behavior

  • Goals are keyed as goal:<session_id> in state_meta
  • When session is pruned/cleaned, goal data is deleted
  • /goal list only shows goals for the current session
  • No cross-session goal indexing mechanism

Root Cause

In hermes_state.py, goals are stored with session-specific keys:

# Goal key pattern
key = f"goal:{session_id}"

There is no separate goal registry or cross-session index.

Suggested Fix

  1. Separate goal storage: Move goals to their own table or use session-independent keys
  2. Global goal index: Add a goals table with columns: goal_id, title, status, created_at, updated_at, tasks
  3. Cross-session listing: /goal list should query all active goals, not just current session
  4. Goal lifecycle: Goals should persist until explicitly completed/cancelled, regardless of session lifecycle

Environment

  • Hermes Agent: latest (as of 2026-05-03)
  • Platform: Telegram gateway
  • OS: macOS (Apple Silicon)

Impact

Users who set up long-term goals (like configuring OpenClaw) lose their task tracking when sessions end. This undermines the purpose of the /goal feature for multi-session workflows.

extent analysis

TL;DR

Separate goal storage from session-specific data to enable persistent goal tracking across sessions.

Guidance

  • Identify the current goal storage mechanism in hermes_state.py and refactor it to use session-independent keys or a separate goals table.
  • Implement a global goal index to facilitate cross-session goal listing and tracking.
  • Update the /goal list command to query all active goals, regardless of the session that created them.
  • Consider adding a goal lifecycle management system to ensure goals persist until explicitly completed or cancelled.

Example

# Proposed goal key pattern
key = f"goal:{goal_id}"

Replace session_id with a unique goal_id to decouple goals from session lifecycles.

Notes

The suggested fix assumes that a goal_id can be generated and stored for each goal. The actual implementation may require additional changes to the database schema and the goal creation process.

Recommendation

Apply workaround: Separate goal storage and implement a global goal index to enable persistent goal tracking across sessions. This approach addresses the root cause of the issue and aligns with the documented intent of the codebase.

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