hermes - 💡(How to fix) Fix [Feature]: Session continuation after max_turns not linked — continuation session orphaned from original thread [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#19818Fetched 2026-05-05 06:05:01
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2cross-referenced ×1
RAW_BUFFERClick to expand / collapse

Problem or Use Case

When Hermes hits max_turns mid-agentic-run, it starts a new session and carries conversation history forward. The continuation session has no linkage back to the original — no parent session ID, no thread marker, no indication it is a continuation. External tooling that relies on session ID continuity or user-message presence loses the thread entirely. Steps to reproduce

Set max_turns to a value likely to be hit during a long agentic task (e.g., 150) Start an agentic run expected to exceed that turn count Allow Hermes to hit the turn limit and start a continuation session Observe the continuation session in state.db or external tooling Observe: no linkage to the original session; continuation appears as an unrelated new session

Expected behavior

Continuation sessions should carry a parent_session_id field (or equivalent) so tooling can reconstruct the full chain. At minimum, a log line at continuation start noting the parent session ID would allow manual reconstruction. Actual behavior The continuation session is indistinguishable from a fresh session. Any tooling that tracks work by session ID treats it as unrelated. The original thread is broken.

Impact

Long agentic runs that span a turn-limit boundary appear as disconnected fragments in dashboards and logs Deduplication logic that strips carried-forward history in the new session has no way to re-associate the continuation with its origin Combined with Issue #[1] (state.db only written at session end), a connection interruption during the continuation window results in complete loss of both the original session's end state and the continuation's work

Reproduction context A wiki reorganization task was running as a long agentic process. Hermes hit max_turns (150), started a continuation session. The continuation didn't begin with a user message, which caused a dashboard reconnection attempt to fail. Since state.db hadn't been written yet for either session, restarting the dashboard orphaned all in-progress content.

Environment

Hermes Agent, max_turns: 150 External dashboard reading state.db directly

Proposed Solution

Add a parent_session_id field to the session record, populated when a session is created as a continuation. Optionally, a continuation: true flag. This would allow any tooling to walk the full chain regardless of how many turn-limit splits occurred.

Alternatives Considered

No response

Feature Type

New tool

Scope

None

Contribution

  • I'd like to implement this myself and submit a PR

Debug Report (optional)

extent analysis

TL;DR

Add a parent_session_id field to the session record to establish linkage between continuation sessions and their originals.

Guidance

  • Identify the session creation logic in Hermes and modify it to populate a parent_session_id field when a new session is created as a continuation.
  • Consider adding a continuation: true flag to the session record for easier identification of continuation sessions.
  • Update external tooling to recognize and utilize the parent_session_id field to reconstruct the full chain of sessions.
  • Verify that the parent_session_id field is correctly populated and utilized by checking the session records in state.db and the behavior of external tooling.

Example

# Pseudocode example of updated session creation logic
def create_session(parent_session_id=None):
    session = {
        'id': generate_session_id(),
        'parent_session_id': parent_session_id,
        'continuation': parent_session_id is not None
    }
    # ...
    return session

Notes

The proposed solution assumes that the session creation logic in Hermes can be modified to accommodate the parent_session_id field. Additionally, the external tooling will need to be updated to recognize and utilize this field.

Recommendation

Apply the proposed solution by adding a parent_session_id field to the session record, as it provides a straightforward way to establish linkage between continuation sessions and their originals, addressing the identified issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Feature]: Session continuation after max_turns not linked — continuation session orphaned from original thread [2 comments, 2 participants]