From 51b2b0cea8288e6a1dccf4d42c6bb429ae1129ee Mon Sep 17 00:00:00 2001 From: MischaPanch Date: Sun, 24 Aug 2025 00:11:31 +0200 Subject: [PATCH] Bugfix - max_answer_chars in write_memory was not using _limit_length So it couldn't just be -1 --- src/serena/tools/memory_tools.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/serena/tools/memory_tools.py b/src/serena/tools/memory_tools.py index 63d6537e..f52ae3f4 100644 --- a/src/serena/tools/memory_tools.py +++ b/src/serena/tools/memory_tools.py @@ -13,6 +13,8 @@ class WriteMemoryTool(Tool): Write some information about this project that can be useful for future tasks to a memory in md format. The memory name should be meaningful. """ + if max_answer_chars == -1: + max_answer_chars = self.agent.serena_config.default_max_tool_answer_chars if len(content) > max_answer_chars: raise ValueError( f"Content for {memory_name} is too long. Max length is {max_answer_chars} characters. " + "Please make the content shorter."