fix: add back_populates to SessionHandoff and SessionResolutionOutput relationships

SQLAlchemy SAWarning about overlapping relationships was promoted to
an error by pytest filterwarnings=error, crashing mapper initialization
and causing 500s on every request — cascading to 423+ test failures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
chihlasm
2026-03-27 17:46:07 +00:00
parent c7abe905f7
commit e130976803
3 changed files with 4 additions and 2 deletions

View File

@@ -253,10 +253,12 @@ class AISession(Base):
)
handoffs: Mapped[list["SessionHandoff"]] = relationship(
"SessionHandoff",
back_populates="session",
cascade="all, delete-orphan",
order_by="SessionHandoff.created_at",
)
resolution_outputs: Mapped[list["SessionResolutionOutput"]] = relationship(
"SessionResolutionOutput",
back_populates="session",
cascade="all, delete-orphan",
)