Skip to content

fix(goals): migrate active goal across compression split#29955

Open
lvLokkie wants to merge 1 commit into
NousResearch:mainfrom
lvLokkie:fix/goal-survives-compression-split
Open

fix(goals): migrate active goal across compression split#29955
lvLokkie wants to merge 1 commit into
NousResearch:mainfrom
lvLokkie:fix/goal-survives-compression-split

Conversation

@lvLokkie

Copy link
Copy Markdown

Summary

  • migrate an active /goal state when context compression rotates session_id
  • preserve the old goal row as cleared for audit instead of deleting it
  • add regression coverage for active-goal migration and inactive/missing no-op cases

Root cause

/goal state is stored in SessionDB.state_meta under goal:<session_id>. Context compression creates a continuation session and updates agent.session_id. After that split, GoalManager(new_session_id) could not find the active goal, so the autonomous goal loop stopped before goals.max_turns with 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='

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

Labels

comp/agent Core agent loop, run_agent.py, prompt builder 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.

[Bug]: /goal silently lost after manual /compress (session_id rebind doesn't migrate goal state)

2 participants