fix(goals): migrate active goal across compression split#29955
Open
lvLokkie wants to merge 1 commit into
Open
Conversation
This was referenced May 28, 2026
This was referenced Jun 12, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
/goalstate when context compression rotatessession_idclearedfor audit instead of deleting itRoot cause
/goalstate is stored inSessionDB.state_metaundergoal:<session_id>. Context compression creates a continuation session and updatesagent.session_id. After that split,GoalManager(new_session_id)could not find the active goal, so the autonomous goal loop stopped beforegoals.max_turnswith no user-facing warning.Notes
This is a focused fix for the auto-compression split path. It is related to the existing reports/PRs around goal persistence across compression, including #18467, #18427, and #18749.
Fixes #18467
Test plan
python -m pytest tests/hermes_cli/test_goals.py::TestGoalManager::test_migrate_goal_session_preserves_active_goal_after_compression_split tests/hermes_cli/test_goals.py::TestGoalManager::test_migrate_goal_session_ignores_inactive_or_missing_goal -q -o 'addopts='python -m pytest tests/hermes_cli/test_goals.py tests/run_agent/test_compression_persistence.py -q -o 'addopts='