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
fix: raise persisted tool result limit to 16k
Re-bin35260ca15745
diff --git a/nanobot/agent/loop.py b/nanobot/agent/loop.pyindex b80c5d05f..ac8700c10 100644--- a/nanobot/agent/loop.py+++ b/nanobot/agent/loop.py@@ -43,7 +43,7 @@ class AgentLoop:5. Sends responses back"""- _TOOL_RESULT_MAX_CHARS = 500+ _TOOL_RESULT_MAX_CHARS = 16_000def __init__(self,diff --git a/tests/test_loop_save_turn.py b/tests/test_loop_save_turn.pyindex aec6d1a9b..25ba88b9b 100644--- a/tests/test_loop_save_turn.py+++ b/tests/test_loop_save_turn.py@@ -5,7 +5,7 @@ from nanobot.session.manager import Sessiondef _mk_loop() -> AgentLoop:loop = AgentLoop.__new__(AgentLoop)- loop._TOOL_RESULT_MAX_CHARS = 500+ loop._TOOL_RESULT_MAX_CHARS = AgentLoop._TOOL_RESULT_MAX_CHARSreturn loop@@ -39,3 +39,17 @@ def test_save_turn_keeps_image_placeholder_after_runtime_strip() -> None:skip=0,)assert session.messages[0]["content"] == [{"type": "text", "text": "[image]"}]+++def test_save_turn_keeps_tool_results_under_16k() -> None:+ loop = _mk_loop()+ session = Session(key="test:tool-result")+ content = "x" * 12_000++ loop._save_turn(+ session,+ [{"role": "tool", "tool_call_id": "call_1", "name": "read_file", "content": content}],+ skip=0,+ )++ assert session.messages[0]["content"] == content