no-mistakes(review): guard token-delta status msg on actual compression in overflow handler

This commit is contained in:
David Gutowsky 2026-06-20 04:06:36 +00:00 committed by kshitijk4poor
parent 47b6b4cf85
commit 87b60ae49a

View file

@ -3170,7 +3170,7 @@ def run_conversation(
if len(messages) < original_len or (new_tokens > 0 and new_tokens < original_tokens * 0.95) or (new_ctx and new_ctx < old_ctx):
if len(messages) < original_len:
agent._buffer_status(f"🗜️ Compressed {original_len}{len(messages)} messages, retrying...")
else:
elif new_tokens > 0 and new_tokens < original_tokens * 0.95:
agent._buffer_status(f"🗜️ Compressed ~{original_tokens:,} → ~{new_tokens:,} tokens, retrying...")
time.sleep(2) # Brief pause between compression retries
_retry.restart_with_compressed_messages = True