hermes - 💡(How to fix) Fix [Bug]: Telegram topic bindings can point at pre-compression sessions [2 pull requests]

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…

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Bug Description

In Telegram DM topic mode, a topic thread can remain bound to the pre-compression Hermes session after context compression rotates/splits the underlying session_id.

The gateway updates the active session_entry.session_id so transcript writes go to the compressed child session, but the persisted Telegram topic binding (chat_id + thread_id -> session_id) can still point at the oversized parent session. On the next message in that same Telegram topic, topic binding restoration switches the gateway back to the old parent session.

Expected Behavior

After compression/session rotation, the Telegram topic binding should point at the new compressed child session. Subsequent messages in the same Telegram topic should continue from the compressed transcript.

Actual Behavior

The next message in the Telegram topic can rebind to the oversized parent session. This makes the conversation appear to compact repeatedly, or continue to carry a very large context even after compression succeeded.

Steps to Reproduce

  1. Enable Telegram DM topic mode for a chat/user.
  2. Bind a Telegram topic thread to an existing Hermes session.
  3. Let gateway context hygiene or agent-side compression rotate that Hermes session to a new child session_id.
  4. Send another message in the same Telegram topic.
  5. Observe that routing may restore the stale topic binding and switch back to the old parent session.

Proposed Fix

When the gateway detects a compression/session rotation, sync the Telegram topic binding to the current session_entry.session_id:

  • after hygiene compression updates session_entry.session_id;
  • after the agent result reports a new session_id from compression.

This should be scoped to Telegram topic lanes only, preserving normal routing behavior for other platforms/session types.

Environment Shape

  • Linux user service gateway managed by systemd user unit.
  • Telegram DM topic mode enabled.
  • Compression enabled.
  • Auxiliary compression model may be slow/unavailable, but the binding bug is independent of the specific model provider.

Privacy Note

This report intentionally uses synthetic IDs and generalized environment details. It does not include any real chat IDs, hostnames, local paths, tokens, or private network addresses.

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 [Bug]: Telegram topic bindings can point at pre-compression sessions [2 pull requests]