Skip to content

fix: reset all retry counters at start of run_conversation()#607

Merged
teknium1 merged 1 commit intoNousResearch:mainfrom
0xbyt4:fix/reset-retry-counters-on-conversation-start
Mar 10, 2026
Merged

fix: reset all retry counters at start of run_conversation()#607
teknium1 merged 1 commit intoNousResearch:mainfrom
0xbyt4:fix/reset-retry-counters-on-conversation-start

Conversation

@0xbyt4
Copy link
Copy Markdown
Contributor

@0xbyt4 0xbyt4 commented Mar 7, 2026

Summary

_incomplete_scratchpad_retries and _codex_incomplete_retries are not reset at the start of run_conversation(). In CLI mode, the same AIAgent instance is reused across conversations, so stale counters carry over.

Impact: After a few conversations with incomplete responses, the agent hits max retries immediately and returns partial results instead of retrying properly.

Fix: Add both counters to the existing reset block at the top of run_conversation() (line 2884), alongside the other retry counters that are already reset there.

Two-line fix — gateway is unaffected since it creates a fresh AIAgent per message.

_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.
@teknium1 teknium1 merged commit f16f291 into NousResearch:main Mar 10, 2026
1 check passed
@teknium1
Copy link
Copy Markdown
Contributor

Merged — thanks @0xbyt4! Good eye spotting the missing resets. You're on a streak today 🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants