Files
hermes-agent/hermes_cli
teknium1 32c89fed18 feat: configurable custom compaction prompt for context compression
Add a compression.prompt config option that lets users override the
default summarization prompt used during context compression.

What changes:

1. ContextCompressor.__init__() accepts compaction_prompt_override param.
   When set (non-empty string), it replaces the default summarization
   instructions in _generate_summary(). The framing (token target, turns
   to summarize, [CONTEXT SUMMARY]: prefix instruction) stays the same.

2. run_agent.py reads CONTEXT_COMPRESSION_PROMPT env var and passes it
   to ContextCompressor.

3. Config wiring — the new 'prompt' key under 'compression' section is
   mapped to CONTEXT_COMPRESSION_PROMPT env var in:
   - cli.py (load_cli_config defaults + env mapping)
   - hermes_cli/config.py (DEFAULT_CONFIG + show_config display)
   - gateway/run.py (gateway env mapping)

Usage in config.yaml:
  compression:
    prompt: 'Your custom summarization instructions here'

Or via environment variable:
  CONTEXT_COMPRESSION_PROMPT='Your custom instructions'

When empty (default), the built-in summarization prompt is used
unchanged. This gives power users control over how context is
compressed without modifying source code.

Inspired by PR #776 by @kshitijk4poor and the research in #499.
2026-03-11 05:45:24 -07:00
..
2026-02-22 02:16:11 -08:00
2026-02-20 23:23:32 -08:00
2026-02-20 23:23:32 -08:00
2026-02-20 23:23:32 -08:00