The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
docs(agent): say why the extension pass re-renders after the cap pre-check
kshitijk4poorf3642a27d877
diff --git a/agent/context_compressor.py b/agent/context_compressor.pyindex 99169cd6562..066fe10fcdf 100644--- a/agent/context_compressor.py+++ b/agent/context_compressor.py@@ -3678,7 +3678,10 @@ Summary generation was unavailable, so this is a best-effort deterministic fallbcontinueselected[idx] = grownnew_len = len(_render(_merged(selected)))- if new_len > cap: # marker widths shrink as records leave a gap; recheck exactly+ # The pre-check above bounds the added record; the exact re-render catches the+ # one thing it cannot see — a gap's first index gaining a digit or comma in the+ # marker (e.g. 999 -> 1,000) when the render is already at cap.+ if new_len > cap:selected[idx] = (s, e)continuerendered_len = new_len