mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
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.
|
||
|---|---|---|
| .. | ||
| __init__.py | ||
| auth.py | ||
| banner.py | ||
| callbacks.py | ||
| clipboard.py | ||
| codex_models.py | ||
| colors.py | ||
| commands.py | ||
| config.py | ||
| cron.py | ||
| curses_ui.py | ||
| doctor.py | ||
| gateway.py | ||
| main.py | ||
| models.py | ||
| pairing.py | ||
| runtime_provider.py | ||
| setup.py | ||
| skills_config.py | ||
| skills_hub.py | ||
| skin_engine.py | ||
| status.py | ||
| tools_config.py | ||
| uninstall.py | ||