From aeadd1aebe4f4589245914e0722eab145ecbe369 Mon Sep 17 00:00:00 2001 From: Kian Jones <11655409+kianjones9@users.noreply.github.com> Date: Fri, 13 Jun 2025 12:16:48 -0700 Subject: [PATCH] fix(ci): autosummarize test fails (pydantic version dependant?) (#2792) --- tests/integration_test_send_message.py | 7 +++++-- tests/test_managers.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/integration_test_send_message.py b/tests/integration_test_send_message.py index 139287a0..90f57e7a 100644 --- a/tests/integration_test_send_message.py +++ b/tests/integration_test_send_message.py @@ -851,13 +851,16 @@ def test_async_greeting_with_assistant_message( ) def test_auto_summarize(disable_e2b_api_key: Any, client: Letta, llm_config: LLMConfig): """Test that summarization is automatically triggered.""" - llm_config.context_window = 3000 + # pydantic prevents us for overriding the context window paramter in the passed LLMConfig + new_llm_config = llm_config.model_dump() + new_llm_config["context_window"] = 3000 + pinned_context_window_llm_config = LLMConfig(**new_llm_config) send_message_tool = client.tools.list(name="send_message")[0] temp_agent_state = client.agents.create( include_base_tools=False, tool_ids=[send_message_tool.id], - llm_config=llm_config, + llm_config=pinned_context_window_llm_config, embedding="letta/letta-free", tags=["supervisor"], ) diff --git a/tests/test_managers.py b/tests/test_managers.py index ed40aa7a..500dcd33 100644 --- a/tests/test_managers.py +++ b/tests/test_managers.py @@ -85,7 +85,7 @@ from letta.schemas.user import UserUpdate from letta.server.db import db_registry from letta.server.server import SyncServer from letta.services.block_manager import BlockManager -from letta.settings import settings, tool_settings +from letta.settings import tool_settings from tests.helpers.utils import comprehensive_agent_checks, validate_context_window_overview from tests.utils import random_string