hermes - 💡(How to fix) Fix Feature request: compress_context command

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…

Add a compress_context tool that lets the agent proactively trigger context compression mid-conversation, rather than waiting for automatic threshold-based compression. This enables autonomous research modes where the agent can manage its own context budget and reset the turn counter before hitting the hard max_iterations limit.

Root Cause

Currently, if the agent approaches max_iterations and automatic compression hasn't triggered (e.g., because tokens are under threshold but turns are high), the conversation hard-stops with no graceful recovery.

Fix Action

Fix / Workaround

This is the beginning of the attached compress_context_feature_request.md file that Kimi generated for me. Full patches are included in the second attached file.

compress_context.patch

RAW_BUFFERClick to expand / collapse

This is the beginning of the attached compress_context_feature_request.md file that Kimi generated for me. Full patches are included in the second attached file.

compress_context_feature_request.md

compress_context.patch

Summary

Add a compress_context tool that lets the agent proactively trigger context compression mid-conversation, rather than waiting for automatic threshold-based compression. This enables autonomous research modes where the agent can manage its own context budget and reset the turn counter before hitting the hard max_iterations limit.

Motivation

Hermes already has excellent automatic context compression (via context_compressor.py), but it only triggers when the token threshold is reached. For long-running autonomous tasks (e.g., research sweeps, multi-step experiments), the agent needs to be able to:

  1. Reset the turn counter before hitting max_iterations — critical for modes with a 200-turn budget where the agent plans its own work in chunks
  2. Preserve specific topics across compressions using the focus_topic parameter
  3. Force compression after a failed automatic attempt without waiting for a cooldown

Currently, if the agent approaches max_iterations and automatic compression hasn't triggered (e.g., because tokens are under threshold but turns are high), the conversation hard-stops with no graceful recovery.

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