fix: drop generic repeated tool-call guard

The global guard changed baseline agent and subagent behavior without
proving a real no-progress loop. Keep this PR focused on the cron
contract hardening and validation fixes.

Made-with: Cursor
This commit is contained in:
Xubin Ren
2026-04-18 19:59:58 +00:00
parent adc1e843b4
commit 9c0dc8b276
4 changed files with 11 additions and 127 deletions
-20
View File
@@ -1,20 +0,0 @@
from nanobot.utils.runtime import repeated_tool_call_error, tool_call_signature
def test_tool_call_signature_sorts_arguments_stably() -> None:
first = tool_call_signature("read_file", {"offset": 1, "path": "memory/history.jsonl"})
second = tool_call_signature("read_file", {"path": "memory/history.jsonl", "offset": 1})
assert first == second
def test_repeated_tool_call_error_blocks_after_two_attempts() -> None:
seen: dict[str, int] = {}
assert repeated_tool_call_error("read_file", {"path": "a.txt"}, seen) is None
assert repeated_tool_call_error("read_file", {"path": "a.txt"}, seen) is None
error = repeated_tool_call_error("read_file", {"path": "a.txt"}, seen)
assert error is not None
assert "repeated identical call to 'read_file' blocked after 2 attempts" in error