Bug description
Persistent /goal state can disappear from the user's point of view after context compression rotates the SQLite session_id.
Goal state is stored in state_meta under goal:<session_id>. During context compression Hermes ends the old session, creates a continuation session with a new id, and continues the same logical conversation. The goal state was not migrated as part of that session split, so a GoalManager created for the continuation session sees no active goal.
Steps to reproduce
- Start a session and set a standing goal with
/goal.
- Let the conversation hit manual or automatic context compression.
- Compression creates a continuation session with a new
session_id.
- Ask for
/goal status or let the goal loop resume in the new session.
Expected behavior
The active or paused goal follows the logical conversation across compression-created continuation sessions.
Actual behavior
The goal remains under goal:<old_session_id>, while the continuation session reads goal:<new_session_id> and appears to have no active goal.
Proposed fix
- Add an explicit goal migration helper that copies unfinished goal state to the continuation session.
- Mark the old goal row as cleared/audit-only after migration to avoid two active rows.
- Invoke migration from the context compression session-rotation path.
- Add a regression test that sets a goal, migrates it across a compression boundary, and verifies the continuation session still sees the active goal.
Bug description
Persistent
/goalstate can disappear from the user's point of view after context compression rotates the SQLitesession_id.Goal state is stored in
state_metaundergoal:<session_id>. During context compression Hermes ends the old session, creates a continuation session with a new id, and continues the same logical conversation. The goal state was not migrated as part of that session split, so aGoalManagercreated for the continuation session sees no active goal.Steps to reproduce
/goal.session_id./goal statusor let the goal loop resume in the new session.Expected behavior
The active or paused goal follows the logical conversation across compression-created continuation sessions.
Actual behavior
The goal remains under
goal:<old_session_id>, while the continuation session readsgoal:<new_session_id>and appears to have no active goal.Proposed fix