From 8c26a057a3a67a6bf120679b12aca32543b2de44 Mon Sep 17 00:00:00 2001 From: 0xbyt4 <35742124+0xbyt4@users.noreply.github.com> Date: Sat, 7 Mar 2026 20:12:08 +0300 Subject: [PATCH] fix: reset all retry counters at start of run_conversation() _incomplete_scratchpad_retries and _codex_incomplete_retries were not reset at the start of run_conversation(). In CLI mode, where the same AIAgent instance is reused across conversations, stale counters from a previous conversation could carry over, causing premature retry exhaustion and partial responses. --- run_agent.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/run_agent.py b/run_agent.py index 1806cf8a..d3292a87 100644 --- a/run_agent.py +++ b/run_agent.py @@ -2884,6 +2884,8 @@ class AIAgent: self._invalid_tool_retries = 0 self._invalid_json_retries = 0 self._empty_content_retries = 0 + self._incomplete_scratchpad_retries = 0 + self._codex_incomplete_retries = 0 self._last_content_with_tools = None self._turns_since_memory = 0 self._iters_since_skill = 0