Skip to content

fix: preserve goals across compression session splits#18427

Open
fadelguy wants to merge 1 commit into
NousResearch:mainfrom
fadelguy:fix/goal-compression-lineage
Open

fix: preserve goals across compression session splits#18427
fadelguy wants to merge 1 commit into
NousResearch:mainfrom
fadelguy:fix/goal-compression-lineage

Conversation

@fadelguy

@fadelguy fadelguy commented May 1, 2026

Copy link
Copy Markdown

Summary

  • 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

@MarisKay

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants