hermes - 💡(How to fix) Fix [Feature]: Session state not written to state.db until session end — agentic runs invisible to external tooling [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#19816Fetched 2026-05-05 06:05:02
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

state.db is only written at session end. For long agentic runs, this means the session is completely invisible to any external tooling (dashboards, monitors, integrations) until the run completes. If the process is interrupted before completion — container restart, connection drop, crash — the session is lost entirely with no record. Steps to reproduce

Start a long agentic task (any multi-tool run expected to take 10+ minutes) Query state.db or any dashboard backed by it during the run Observe: no session record exists, no turn data, no indication work is in progress Kill the container before the session completes Observe: session never appears in state.db

Expected behavior A session record should be created (or at minimum reserved) when the session starts. Turn data should be written incrementally, or at least a heartbeat/status field should update during the run so external tooling can observe in-progress work. Actual behavior Nothing is written until session end. The entire run is a black box to any consumer of state.db. Impact

Dashboards and monitoring tools show no activity during long agentic runs, creating a false "nothing is happening" signal Any interruption during a run results in complete data loss — no partial record, no turn history, no recovery path Combining with Issue #[2] (session continuation after max_turns), interrupted runs that span multiple sessions are entirely unrecoverable

Environment

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

Proposed Solution

Write a session record on turn 1 with a status of in_progress. Update status to complete on clean session end. Even a single initial write would allow external tooling to detect that a run is active. Incremental turn writes would be better but may have performance tradeoffs worth discussing.

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

Writing a session record at the start of a long agentic run, with incremental updates, can help external tooling track progress and prevent data loss.

Guidance

  • Consider implementing a mechanism to write a session record to state.db at the beginning of a long agentic run, with a status indicating the session is in progress.
  • Update the session record incrementally, or at least provide a heartbeat/status field, to allow external tooling to observe progress.
  • Evaluate potential performance tradeoffs of incremental turn writes to determine the best approach.
  • Review the proposed solution to write a session record on turn 1 with a status of in_progress and update to complete on clean session end.

Example

No code example is provided as the issue does not contain sufficient technical details to generate a specific implementation.

Notes

The solution may require careful consideration of performance implications and potential data consistency issues.

Recommendation

Apply workaround: Implement a mechanism to write a session record at the start of a long agentic run, with incremental updates, to provide visibility into ongoing sessions and prevent data loss. This approach allows for external tooling to track progress and reduces the risk of complete data loss in case of interruptions.

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 state not written to state.db until session end — agentic runs invisible to external tooling [2 comments, 2 participants]