hermes - 💡(How to fix) Fix Add idle time-gap pre-compression for stale near-limit sessions

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…

Code Example

compression:
  idle_gap_seconds: 14400
  idle_precompress_threshold: 0.40   # lower than normal 0.50 trigger
  idle_precompress_enabled: true
RAW_BUFFERClick to expand / collapse

Problem

Long-running Telegram/gateway sessions often sit idle while already near the compression threshold. When the user comes back hours later, the next one or two messages can immediately trigger auto-compression. That interrupts the train of thought at exactly the worst time: right after the user has re-entered the conversation.

Proposed behavior

Add idle/time-gap pre-compression so Hermes can compact stale-near-limit sessions before the user returns.

Suggested default:

  • If a session has been idle for >= 4 hours, check estimated prompt tokens and/or message count.
  • If it is above a configurable pre-compression threshold, run compression before accepting the next live user turn or during gateway hygiene.
  • Keep normal safety rules: preserve latest user ask, system prompt, protected head, recent tail, tool-pair integrity, and historical media stripping.

Candidate design

Add config under compression or gateway hygiene, for example:

compression:
  idle_gap_seconds: 14400
  idle_precompress_threshold: 0.40   # lower than normal 0.50 trigger
  idle_precompress_enabled: true

Potential integration points:

  • Gateway session hygiene pass: proactively compress idle sessions that are near threshold.
  • Message receive path: if last activity gap exceeds threshold, compress before appending/processing the new user message so the first returning turn stays coherent.
  • CLI/manual sessions: optional equivalent when resuming a stored session.

Acceptance criteria

  • Returning after a long idle gap does not immediately trip auto-compression 1-2 messages later when the session was already near the limit.
  • The idle compression event is logged visibly enough to diagnose.
  • The feature is configurable and defaults conservatively.
  • Existing compression tests still pass, especially latest-user anchoring and tool-call/result sanitization.

Notes

This is about conversation ergonomics, not just token budgeting. Compression is currently technically correct but socially rude. A small achievement, as machines go.

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