mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-26 01:01:40 +00:00
compress() checks both the head and tail neighbors when choosing the summary message role. When only the tail collides, the role is flipped. When BOTH roles would create consecutive same-role messages (e.g. head=assistant, tail=user), the summary is merged into the first tail message instead of inserting a standalone message that breaks role alternation and causes API 400 errors. The previous code handled head-side collision but left the tail-side uncovered — long conversations would crash mid-reply with no useful error, forcing the user to /reset and lose session history. Based on PR #1186 by @alireza78a, with improved double-collision handling (merge into tail instead of unconditional 'user' fallback). Co-authored-by: alireza78a <alireza78.crypto@gmail.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_auxiliary_client.py | ||
| test_context_compressor.py | ||
| test_display_emoji.py | ||
| test_model_metadata.py | ||
| test_prompt_builder.py | ||
| test_prompt_caching.py | ||
| test_redact.py | ||
| test_skill_commands.py | ||
| test_smart_model_routing.py | ||
| test_subagent_progress.py | ||
| test_title_generator.py | ||
| test_usage_pricing.py | ||