Skip to content

Your lightweight open-source personal agent.

fix(utils): remove unreachable dead code in find_legal_message_start

chengyongru73a8d8a8755a
diff --git a/nanobot/utils/helpers.py b/nanobot/utils/helpers.py
index b047e24d2..0655b4439 100644
--- a/nanobot/utils/helpers.py
+++ b/nanobot/utils/helpers.py
@@ -165,11 +165,6 @@ def find_legal_message_start(messages: list[dict[str, Any]]) -> int:
if tid and str(tid) not in declared:
start = i + 1
declared.clear()
- for prev in messages[start : i + 1]:
- if prev.get("role") == "assistant":
- for tc in prev.get("tool_calls") or []:
- if isinstance(tc, dict) and tc.get("id"):
- declared.add(str(tc["id"]))
return start