From dbbbecb25c0fb528090766c379265dc84faa13c9 Mon Sep 17 00:00:00 2001 From: 3927o <1624497311@qq.com> Date: Thu, 12 Feb 2026 23:57:34 +0800 Subject: [PATCH] feat: improve fallback message when max iterations reached --- nanobot/agent/loop.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nanobot/agent/loop.py b/nanobot/agent/loop.py index a660436..4532b4c 100644 --- a/nanobot/agent/loop.py +++ b/nanobot/agent/loop.py @@ -243,7 +243,10 @@ class AgentLoop: break if final_content is None: - final_content = "I've completed processing but have no response to give." + if iteration >= self.max_iterations: + final_content = f"Reached {self.max_iterations} iterations without completion." + else: + final_content = "I've completed processing but have no response to give." # Log response preview preview = final_content[:120] + "..." if len(final_content) > 120 else final_content