Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
fix: Fix cascade deletion (#1641)
Matthew Zhoubb0ea1844fa8
diff --git a/letta/orm/organization.py b/letta/orm/organization.pyindex df0ea75e8..22edb215a 100644--- a/letta/orm/organization.py+++ b/letta/orm/organization.py@@ -51,8 +51,10 @@ class Organization(SqlalchemyBase):providers: Mapped[List["Provider"]] = relationship("Provider", back_populates="organization", cascade="all, delete-orphan")identities: Mapped[List["Identity"]] = relationship("Identity", back_populates="organization", cascade="all, delete-orphan")groups: Mapped[List["Group"]] = relationship("Group", back_populates="organization", cascade="all, delete-orphan")- llm_batch_jobs: Mapped[List["Agent"]] = relationship("LLMBatchJob", back_populates="organization", cascade="all, delete-orphan")- llm_batch_items: Mapped[List["Agent"]] = relationship("LLMBatchItem", back_populates="organization", cascade="all, delete-orphan")+ llm_batch_jobs: Mapped[List["LLMBatchJob"]] = relationship("LLMBatchJob", back_populates="organization", cascade="all, delete-orphan")+ llm_batch_items: Mapped[List["LLMBatchItem"]] = relationship(+ "LLMBatchItem", back_populates="organization", cascade="all, delete-orphan"+ )@propertydef passages(self) -> List[Union["SourcePassage", "AgentPassage"]]:diff --git a/tests/integration_test_summarizer.py b/tests/integration_test_summarizer.pyindex ff446b4d2..00e927332 100644--- a/tests/integration_test_summarizer.py+++ b/tests/integration_test_summarizer.py@@ -9,14 +9,12 @@ import pytestfrom letta import create_clientfrom letta.agent import Agentfrom letta.client.client import LocalClient-from letta.errors import ContextWindowExceededErrorfrom letta.llm_api.helpers import calculate_summarizer_cutofffrom letta.schemas.embedding_config import EmbeddingConfigfrom letta.schemas.enums import MessageRolefrom letta.schemas.letta_message_content import TextContentfrom letta.schemas.llm_config import LLMConfigfrom letta.schemas.message import Message-from letta.settings import summarizer_settingsfrom letta.streaming_interface import StreamingRefreshCLIInterfacefrom tests.helpers.endpoints_helper import EMBEDDING_CONFIG_PATHfrom tests.helpers.utils import cleanup