mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-09 13:21:42 +00:00
fix(context): clamp -1 post-compression sentinel in sibling status paths
Whole-bug-class follow-up to the tui_gateway fix: the same -1 last_prompt_tokens sentinel (parked by conversation_compression after a compression) leaked into other status readers, producing a raw -1 or a NEGATIVE usage_percent on the transitional turn: - agent/context_engine.py get_status() (the ABC default every external context engine inherits) — highest blast radius - gateway/slash_commands.py /usage context line - cli.py session usage printout All clamped to >=0, mirroring cli.py _get_status_bar_snapshot and the tui_gateway fix. Adds an ABC get_status sentinel-clamp regression test.
This commit is contained in:
parent
b6d8fc41c8
commit
8db6ed7bd9
5 changed files with 26 additions and 8 deletions
2
cli.py
2
cli.py
|
|
@ -9261,7 +9261,7 @@ class HermesCLI(CLIAgentSetupMixin, CLICommandsMixin):
|
|||
total = agent.session_total_tokens
|
||||
|
||||
compressor = agent.context_compressor
|
||||
last_prompt = compressor.last_prompt_tokens
|
||||
last_prompt = compressor.last_prompt_tokens if compressor.last_prompt_tokens > 0 else 0
|
||||
ctx_len = compressor.context_length
|
||||
pct = min(100, (last_prompt / ctx_len * 100)) if ctx_len else 0
|
||||
compressions = compressor.compression_count
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue