From b7de21131f5e79976c601bd44f8614f0549ca7e0 Mon Sep 17 00:00:00 2001 From: Subal Date: Fri, 17 Apr 2026 14:08:54 +0530 Subject: [PATCH] fixed the CI issue and reverted the formating changes --- nanobot/agent/runner.py | 15 ++++----------- nanobot/providers/base.py | 6 +++++- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/nanobot/agent/runner.py b/nanobot/agent/runner.py index 6b887f14..d6fdc5f9 100644 --- a/nanobot/agent/runner.py +++ b/nanobot/agent/runner.py @@ -40,17 +40,10 @@ _MAX_INJECTION_CYCLES = 5 _SNIP_SAFETY_BUFFER = 1024 _MICROCOMPACT_KEEP_RECENT = 10 _MICROCOMPACT_MIN_CHARS = 500 -_COMPACTABLE_TOOLS = frozenset( - { - "read_file", - "exec", - "grep", - "glob", - "web_search", - "web_fetch", - "list_dir", - } -) +_COMPACTABLE_TOOLS = frozenset({ + "read_file", "exec", "grep", "glob", + "web_search", "web_fetch", "list_dir", +}) _BACKFILL_CONTENT = "[Tool result unavailable — call was interrupted or lost]" diff --git a/nanobot/providers/base.py b/nanobot/providers/base.py index 92de0bc6..27ea1e18 100644 --- a/nanobot/providers/base.py +++ b/nanobot/providers/base.py @@ -81,7 +81,11 @@ class LLMResponse: """ if not self.has_tool_calls: return False - return self.finish_reason == "tool_calls" + if self.finish_reason == "tool_calls": + return True + if self.finish_reason == "stop": + return True + return False @dataclass(frozen=True)