Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix: update tests for CORE_MEMORY_BLOCK_CHAR_LIMIT increase to 100k (#9645)

github-actions[bot]86ff216dc977
diff --git a/tests/managers/test_block_manager.py b/tests/managers/test_block_manager.py
index 8f6408cfb..ddfe4a2c1 100644
--- a/tests/managers/test_block_manager.py
+++ b/tests/managers/test_block_manager.py
@@ -562,7 +562,9 @@ async def test_update_block(server: SyncServer, default_user):
@pytest.mark.asyncio
async def test_update_block_limit(server: SyncServer, default_user):
block_manager = BlockManager()
- block = await block_manager.create_or_update_block_async(PydanticBlock(label="persona", value="Original Content"), actor=default_user)
+ block = await block_manager.create_or_update_block_async(
+ PydanticBlock(label="persona", value="Original Content", limit=20000), actor=default_user
+ )
limit = len("Updated Content") * 2000
update_data = BlockUpdate(value="Updated Content" * 2000, description="Updated description")
diff --git a/tests/test_log_context_middleware.py b/tests/test_log_context_middleware.py
index bf6e650ee..9cf0e1006 100644
--- a/tests/test_log_context_middleware.py
+++ b/tests/test_log_context_middleware.py
@@ -52,8 +52,8 @@ class TestLogContextMiddleware:
async def get_files(self, agent_id, org_id, ref):
assert ref == "HEAD"
return {
- "system/human.md": "---\ndescription: human\nlimit: 20000\n---\nname: sarah",
- "system/persona.md": "---\ndescription: persona\nlimit: 20000\n---\nbe helpful",
+ "system/human.md": "---\ndescription: human\n---\nname: sarah",
+ "system/persona.md": "---\ndescription: persona\n---\nbe helpful",
}
class DummyMemoryRepoManager:
diff --git a/tests/test_memory.py b/tests/test_memory.py
index 7c83bebef..334ff5bc4 100644
--- a/tests/test_memory.py
+++ b/tests/test_memory.py
@@ -25,9 +25,9 @@ def test_chat_memory_init_and_utils(chat_memory: Memory):
def test_memory_limit_validation(chat_memory: Memory):
with pytest.raises(ValueError):
- ChatMemory(persona="x " * 50000, human="y " * 50000)
+ ChatMemory(persona="x " * 60000, human="y " * 60000)
with pytest.raises(ValueError):
- chat_memory.get_block("persona").value = "x " * 50000
+ chat_memory.get_block("persona").value = "x " * 60000
def test_get_block_not_found(chat_memory: Memory):