Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
refactor(agent): trim recovery tail anchor
chengyongru154cbc1974bb
diff --git a/nanobot/utils/runtime.py b/nanobot/utils/runtime.pyindex 8ffe62770..e755fa5be 100644--- a/nanobot/utils/runtime.py+++ b/nanobot/utils/runtime.py@@ -14,7 +14,7 @@ _MAX_REPEAT_EXTERNAL_LOOKUPS = 2# Third same-target workspace violation in a turn escalates to "stop retrying"._MAX_REPEAT_WORKSPACE_VIOLATIONS = 2-_LENGTH_RECOVERY_TAIL_CHARS = 500+_LENGTH_RECOVERY_TAIL_CHARS = 64EMPTY_FINAL_RESPONSE_MESSAGE = ("I completed the tool steps but couldn't produce a final answer. "diff --git a/tests/utils/test_runtime.py b/tests/utils/test_runtime.pyindex 56e2f2bc6..40aa5b054 100644--- a/tests/utils/test_runtime.py+++ b/tests/utils/test_runtime.py@@ -3,7 +3,7 @@ from nanobot.utils.runtime import build_length_recovery_messagedef test_length_recovery_message_anchors_the_existing_tail() -> None:omitted_prefix = "OMITTED_PREFIX"- tail = "x" * 500+ tail = "x" * 64message = build_length_recovery_message(omitted_prefix + tail)