From 27c023e07119d3a705f51353ee7c6f0c9a2173cb Mon Sep 17 00:00:00 2001 From: Teknium Date: Tue, 24 Mar 2026 18:05:43 -0700 Subject: [PATCH] feat(config): expose compression target_ratio, protect_last_n, and threshold in DEFAULT_CONFIG PR #2554 made these configurable via config.yaml but didn't add them to DEFAULT_CONFIG or the config display. Users couldn't discover the new knobs without reading the source. - threshold: 0.80 (compress at 80% context usage) - target_ratio: 0.40 (preserve 40% of context as recent tail) - protect_last_n: 20 (keep last 20 messages uncompressed) - Updated hermes config display to show all three fields --- hermes_cli/config.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hermes_cli/config.py b/hermes_cli/config.py index 857b784d2..f96324fd8 100644 --- a/hermes_cli/config.py +++ b/hermes_cli/config.py @@ -163,8 +163,10 @@ DEFAULT_CONFIG = { "compression": { "enabled": True, - "threshold": 0.50, - "summary_model": "", # empty = use main configured model + "threshold": 0.80, # compress when context usage exceeds this ratio + "target_ratio": 0.40, # fraction of context to preserve as recent tail + "protect_last_n": 20, # minimum recent messages to keep uncompressed + "summary_model": "", # empty = use main configured model "summary_provider": "auto", "summary_base_url": None, }, @@ -1684,7 +1686,9 @@ def show_config(): enabled = compression.get('enabled', True) print(f" Enabled: {'yes' if enabled else 'no'}") if enabled: - print(f" Threshold: {compression.get('threshold', 0.50) * 100:.0f}%") + print(f" Threshold: {compression.get('threshold', 0.80) * 100:.0f}%") + print(f" Target ratio: {compression.get('target_ratio', 0.40) * 100:.0f}% of context preserved") + print(f" Protect last: {compression.get('protect_last_n', 20)} messages") _sm = compression.get('summary_model', '') or '(main model)' print(f" Model: {_sm}") comp_provider = compression.get('summary_provider', 'auto')