From 9a31571b6dd9e5aec13df46aebdd13d65ccb99ad Mon Sep 17 00:00:00 2001 From: Re-bin Date: Fri, 20 Feb 2026 16:49:40 +0000 Subject: [PATCH] fix: don't append interim assistant message before retry to avoid prefill errors --- nanobot/agent/loop.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/nanobot/agent/loop.py b/nanobot/agent/loop.py index 9f1e265..4850f9c 100644 --- a/nanobot/agent/loop.py +++ b/nanobot/agent/loop.py @@ -253,10 +253,6 @@ class AgentLoop: if not tools_used and not text_only_retried and final_content: text_only_retried = True logger.debug("Interim text response (no tools used yet), retrying: {}", final_content[:80]) - messages = self.context.add_assistant_message( - messages, response.content, - reasoning_content=response.reasoning_content, - ) final_content = None continue break