hermes - 💡(How to fix) Fix Expose stable message metadata in TUI session.history

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…
RAW_BUFFERClick to expand / collapse

Problem

The TUI gateway session.history RPC currently returns display-oriented message objects from _history_to_messages(...), e.g. { role, text } for user/assistant messages and { role: "tool", name, context } for tool results.

Those objects preserve array order but do not expose stable per-message metadata such as:

  • SQLite message row id
  • persisted message timestamp
  • stable history index / sequence number

Hermes already persists message timestamps in hermes_state.py (messages.timestamp REAL NOT NULL) and restores sessions with ORDER BY timestamp, id, but that metadata is not available to clients of session.history.

Downstream impact

External UI adapters that integrate through the TUI JSON-RPC bridge need a stable way to merge, deduplicate, cache, and display session history. Without timestamps or ids, clients may be forced to synthesize createdAt values at read time. That can cause stale conversations to appear newly active after simply reading/resuming history, and can make ordering fragile when history is cached outside Hermes.

Request

Please include stable metadata in session.history responses, ideally:

  • id: persisted message row id when available, or another stable message id
  • timestamp: original persisted timestamp, preferably seconds or milliseconds since epoch, or ISO string
  • index: stable ordinal within the returned history as a fallback

This can be additive so existing clients that only read role/text/name/context keep working.

Relevant code

  • tui_gateway/server.py: @method("session.history") and _history_to_messages(...)
  • hermes_state.py: messages.timestamp, get_messages(), get_messages_as_conversation()

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