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
..
__init__.py Hermes Agent UX Improvements 2026-02-22 02:16:11 -08:00
auth.py fix: sort Nous Portal model list (opus first, sonnet lower) 2026-03-10 23:20:46 -07:00
banner.py feat: add data-driven skin/theme engine for CLI customization 2026-03-10 00:37:28 -07:00
callbacks.py refactor: reorganize agent and CLI structure for improved clarity 2026-02-21 23:17:18 -08:00
clipboard.py fix: clean up empty file after failed wl-paste clipboard extraction 2026-03-11 02:56:19 -07:00
codex_models.py fix: unify visibility filter in codex model discovery 2026-03-10 15:15:33 +03:00
colors.py Cleanup time! 2026-02-20 23:23:32 -08:00
commands.py feat: add /background command to gateway and CLI commands registry 2026-03-11 02:46:31 -07:00
config.py feat: configurable custom compaction prompt for context compression 2026-03-11 05:45:24 -07:00
cron.py refactor: streamline cron job handling and update CLI commands 2026-02-21 16:21:19 -08:00
curses_ui.py refactor: extract shared curses checklist, fix skill discovery perf 2026-03-11 03:06:15 -07:00
doctor.py fix: add Kimi Code API support (api.kimi.com/coding/v1) 2026-03-07 21:00:12 -05:00
gateway.py fix: Slack gateway setup missing event subscriptions and scopes 2026-03-09 14:31:19 -07:00
main.py fix(cli): resolve duplicate 'skills' subparser crash on Python 3.11+ 2026-03-11 00:50:39 -07:00
models.py fix: custom endpoint provider shows as openrouter in gateway 2026-03-09 02:38:34 -07:00
pairing.py Cleanup time! 2026-02-20 23:23:32 -08:00
runtime_provider.py fix: provider selection not persisting when switching via hermes model 2026-03-10 17:12:34 -07:00
setup.py Merge PR #770: fix: off-by-one in setup toggle selection error message 2026-03-11 02:50:52 -07:00
skills_config.py refactor: extract shared curses checklist, fix skill discovery perf 2026-03-11 03:06:15 -07:00
skills_hub.py fix: Initialize Skills Hub on list 2026-03-09 01:43:59 +08:00
skin_engine.py fix: add themed hero art for all skins, fix triple-quote syntax 2026-03-10 03:54:12 -07:00
status.py Merge PR #458: Add explicit UTF-8 encoding to config/data file I/O 2026-03-09 21:19:20 -07:00
tools_config.py refactor: extract shared curses checklist, fix skill discovery perf 2026-03-11 03:06:15 -07:00
uninstall.py Cleanup time! 2026-02-20 23:23:32 -08:00