You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
make /goal resolve goal state through compression-linked session lineage
keep writes attached to the resolved goal owner instead of blindly using the current physical session id
add regression tests for child sessions, post-turn evaluation, and multi-hop compression chains
Problem
PR #18262 stores standing goals under goal:<session_id>. That works while a conversation stays on one physical session row, but Hermes can split a session during context compression and continue work on a child session.
After that split, the logical conversation continues, but /goal looked only at the child session id. If the goal lived on the compression parent, GoalManager saw no active goal and continuation silently stopped.
Root cause
GoalManager assumed a stable single session_id, while Hermes session state already supports compression lineage via parent_session_id and resume resolution.
Fix
This change teaches goal loading to walk backward through a true compression chain and adopt the nearest visible ancestor goal for the active conversation. It does not borrow goals from arbitrary parent-linked sessions; adoption only happens when the ancestor session ended with end_reason='compression'.
Test plan
pytest tests/hermes_cli/test_goals.py -q
regression: goal visible from compression child session
regression: evaluate_after_turn() updates the resolved goal owner across a compression split
regression: goal resolves across multiple compression hops
why only manual /compress - any compress. If my llama.cpp decides that its time to compress, the result is the same - goal is lost as never existed. Pls fix this, otherwise every serious task we try to solve, ends up losing the goal settings.
Thanks for this — the diagnosis and fix are correct for the rotation path.
Context on why we're closing it: as of #52658 (#38763), compression.in_place now defaults to True. Compaction keeps ONE durable session id for the conversation's whole life — it no longer ends the session and forks a continuation id. Because the id no longer rotates, the active /goal stays attached to the same session automatically — there is no rotation boundary to migrate the goal across.
Rotation now only runs as an explicit opt-out (compression.in_place: false), and the direction is to treat that path as legacy. So this fix hardens a code path that no longer executes by default and that we're not investing further in. Closing as superseded by the in-place default — not a reflection on the code, which was a correct fix for the behavior at the time. Credit preserved in the issue/PR history. Appreciate the contribution.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
comp/cliCLI entry point, hermes_cli/, setup wizardP2Medium — degraded but workaround existstype/bugSomething isn't working
4 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/goalresolve goal state through compression-linked session lineageProblem
PR #18262 stores standing goals under
goal:<session_id>. That works while a conversation stays on one physical session row, but Hermes can split a session during context compression and continue work on a child session.After that split, the logical conversation continues, but
/goallooked only at the child session id. If the goal lived on the compression parent,GoalManagersaw no active goal and continuation silently stopped.Root cause
GoalManagerassumed a stable singlesession_id, while Hermes session state already supports compression lineage viaparent_session_idand resume resolution.Fix
This change teaches goal loading to walk backward through a true compression chain and adopt the nearest visible ancestor goal for the active conversation. It does not borrow goals from arbitrary parent-linked sessions; adoption only happens when the ancestor session ended with
end_reason='compression'.Test plan
pytest tests/hermes_cli/test_goals.py -qevaluate_after_turn()updates the resolved goal owner across a compression split