fix: don't append interim assistant message before retry to avoid prefill errors

This commit is contained in:
Re-bin
2026-02-20 16:49:40 +00:00
parent 21dd9e4112
commit 9a31571b6d

View File

@@ -253,10 +253,6 @@ class AgentLoop:
if not tools_used and not text_only_retried and final_content: if not tools_used and not text_only_retried and final_content:
text_only_retried = True text_only_retried = True
logger.debug("Interim text response (no tools used yet), retrying: {}", final_content[:80]) 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 final_content = None
continue continue
break break