From 154cbc1974bb8aa315ad686b7e56c1563d17142c Mon Sep 17 00:00:00 2001 From: chengyongru Date: Thu, 23 Jul 2026 17:14:58 +0800 Subject: [PATCH] refactor(agent): trim recovery tail anchor --- nanobot/utils/runtime.py | 2 +- tests/utils/test_runtime.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nanobot/utils/runtime.py b/nanobot/utils/runtime.py index 8ffe6277..e755fa5b 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 = 64 EMPTY_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.py index 56e2f2bc..40aa5b05 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_message def test_length_recovery_message_anchors_the_existing_tail() -> None: omitted_prefix = "OMITTED_PREFIX" - tail = "x" * 500 + tail = "x" * 64 message = build_length_recovery_message(omitted_prefix + tail)