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
preserve persistent /goal state when compression rotates agent.session_id into a continuation session
add fail-soft goal migration helper that copies only unfinished goals and archives the source as non-active
add lineage recovery for already-created compression children plus regression coverage for direct migration and the real compression boundary
Why
GoalManager stores state in SessionDB.state_meta under goal:<session_id>. Compression creates a new child session id, so the next GoalManager(new_session_id) used to miss the active goal and the judging/continuation loop stopped silently.
Safety
no-op for missing, done, cleared, blank, or same-session goals
does not overwrite destination active, paused, or done goals
migration errors are logged at debug level and never break the main conversation turn
source goal is archived as cleared instead of deleting metadata
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/agentCore agent runtime: loop, agent_init, prompt builder, context-compression, responses endpointcomp/cliCLI entry point, hermes_cli/, setup wizardP2Medium — degraded but workaround existstype/bugSomething isn't working
3 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
/goalstate when compression rotatesagent.session_idinto a continuation sessionWhy
GoalManagerstores state inSessionDB.state_metaundergoal:<session_id>. Compression creates a new child session id, so the nextGoalManager(new_session_id)used to miss the active goal and the judging/continuation loop stopped silently.Safety
active,paused, ordonegoalsclearedinstead of deleting metadataTests
python3 -m pytest tests/hermes_cli/test_goals.py tests/run_agent/test_compression_boundary_hook.py -q -o 'addopts='— 60 passed, 1 warningpython3 -m pytest tests/run_agent/test_compression_boundary_hook.py tests/run_agent/test_compression_persistence.py tests/run_agent/test_compression_boundary.py tests/gateway/test_compression_session_id_persistence.py tests/agent/test_compression_concurrent_fork.py tests/hermes_cli/test_goals.py -q -o 'addopts='— 76 passed, 1 warningFixes #33618.