Skip to content

Commit e0c2d35

Browse files
author
dori
committed
feat: improve memory cleanup when plan approve
1 parent a1daecb commit e0c2d35

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/mcp_as_a_judge/db/providers/sqlite_provider.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,11 @@ async def delete_previous_plan(self, session_id: str) -> None:
345345
return
346346

347347
# Delete records using SQL IN clause with underlying SQLAlchemy session
348-
delete_stmt = delete(ConversationRecord).where(
349-
ConversationRecord.id.in_(record_ids_to_delete)
348+
# Use the table name from ConversationRecord to avoid type issues
349+
table_name = ConversationRecord.__tablename__
350+
table = SQLModel.metadata.tables[table_name]
351+
delete_stmt = delete(table).where(
352+
table.c.id.in_(record_ids_to_delete)
350353
)
351354
# Use the underlying SQLAlchemy session for delete operations
352355
session.execute(delete_stmt)

0 commit comments

Comments
 (0)