From 87b60ae49a9f9bb61fa57468e68344e4d4113a64 Mon Sep 17 00:00:00 2001 From: David Gutowsky Date: Sat, 20 Jun 2026 04:06:36 +0000 Subject: [PATCH] no-mistakes(review): guard token-delta status msg on actual compression in overflow handler --- agent/conversation_loop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/conversation_loop.py b/agent/conversation_loop.py index 421629b4b03..bbc379adf25 100644 --- a/agent/conversation_loop.py +++ b/agent/conversation_loop.py @@ -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