feat(compression): make protect_first_n configurable

The number of head messages preserved verbatim across context compactions
was previously hardcoded to 3 in AIAgent.__init__. Expose it as
compression.protect_first_n in config, matching the existing
protect_last_n pattern.

Motivation: users who rely on rolling compaction for long-running
sessions had the opening user/assistant exchange pinned as head
forever, which doesn't always match how they want the session framed
after many compactions. Lowering to 1 preserves only the system
prompt and lets the first exchange age out naturally through the
summary.

- hermes_cli/config.py: add default (3) + show_config() line
- run_agent.py: read from config with max(1, ...) floor so the
  system prompt always survives head-protection
- cli-config.yaml.example: document with rationale
- tests/agent/test_context_compressor.py: cover default, override,
  and end-to-end behavior when protect_first_n=1
- scripts/release.py: add simpolism@gmail.com to AUTHOR_MAP
This commit is contained in:
simpolism 2026-04-21 21:13:47 -04:00
parent 83a7a005aa
commit 46b75960ed
5 changed files with 67 additions and 1 deletions

View file

@ -183,6 +183,7 @@ AUTHOR_MAP = {
"m@statecraft.systems": "mbierling",
"balyan.sid@gmail.com": "alt-glitch",
"oluwadareab12@gmail.com": "bennytimz",
"simpolism@gmail.com": "simpolism",
"simon@simonmarcus.org": "simon-marcus",
"xowiekk@gmail.com": "Xowiek",
"1243352777@qq.com": "zons-zhaozhy",