mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-16 09:31:37 +00:00
fix(context_compressor): off-by-one in tail protection for short conversations
This commit is contained in:
parent
2997ef9446
commit
b194617d00
1 changed files with 1 additions and 1 deletions
|
|
@ -538,7 +538,7 @@ class ContextCompressor(ContextEngine):
|
|||
# Token-budget approach: walk backward accumulating tokens
|
||||
accumulated = 0
|
||||
boundary = len(result)
|
||||
min_protect = min(protect_tail_count, len(result) - 1)
|
||||
min_protect = min(protect_tail_count, len(result))
|
||||
for i in range(len(result) - 1, -1, -1):
|
||||
msg = result[i]
|
||||
raw_content = msg.get("content") or ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue