Skip to content

fix(goal): keep goals across session lineage - #48369

Closed
ygc3817922006-sketch wants to merge 1 commit into
NousResearch:mainfrom
ygc3817922006-sketch:fix/goal-session-lineage
Closed

fix(goal): keep goals across session lineage#48369
ygc3817922006-sketch wants to merge 1 commit into
NousResearch:mainfrom
ygc3817922006-sketch:fix/goal-session-lineage

Conversation

@ygc3817922006-sketch

Copy link
Copy Markdown

Summary

  • Keep /goal state attached to the whole conversation lineage instead of one transient session id.
  • Preserve active or paused legacy goals when compression/resume creates child sessions.
  • Migrate goal state before session delete/prune operations can orphan it.
  • Prevent delegate/subagent child sessions from accidentally inheriting the parent goal.

Test Plan

  • /Users/yu/.hermes/hermes-agent/venv/bin/python -m pytest tests/hermes_cli/test_aux_config.py tests/tui_gateway/test_goal_command.py -q
  • git diff --check

@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists labels Jun 18, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related: #18427, #38231, #47408, #41478, #29955 (open fix PRs for the same root cause, #33618 / #18467 — persistent /goal lost after compression rotates session_id). Those PRs migrate goal state at the compression boundary (migrate_goal(old, new) in conversation_compression.py); this PR takes a different mechanism — re-keying goal storage to the conversation lineage root (goal:<root_session_id>) and walking parent lineage, plus delegate-child exclusion and migrate-before-prune. Same goal, different approach -> related, not duplicate.

@alaamohanad169-ship-it

Copy link
Copy Markdown
Contributor

Note: This is NOT a duplicate of the prior closed PRs (#18427, #38231, #47408, #41478, #29955, #33618, #18467). The earlier PRs were closed because they were stale (far behind upstream main). This version has been cherry-picked onto the latest origin/main with a clean diff containing only the fix changes. No conflicts. CI green. Ready for review.

@ygc3817922006-sketch ygc3817922006-sketch closed this by deleting the head repository Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint 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