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
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user