Bugfix - max_answer_chars in write_memory was not using _limit_length

So it couldn't just be -1
This commit is contained in:
MischaPanch authored and Michael Panchenko committed 2025-08-24 00:14:08 +02:00
1 parent e316cae5c8
commit 51b2b0cea8
1 file changed
+2
+2
View File
@@ -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."