Fix sync route for list messages for step (#5764)

* fix: list messages for step route

* fix: list messages for step route

---------

Co-authored-by: Shubham Naik <shub@memgpt.ai>
This commit is contained in:
Shubham Naik
2025-10-27 18:17:20 -07:00
committed by Caren Thomas
parent e7fff12da0
commit e3b0398aee

View File

@@ -278,15 +278,14 @@ class StepManager:
ascending: bool = False,
) -> List[PydanticMessage]:
async with db_registry.async_session() as session:
messages = MessageModel.list(
messages = await MessageModel.list_async(
db_session=session,
before=before,
after=after,
ascending=ascending,
limit=limit,
actor=actor,
join_model=StepModel,
join_conditions=[MessageModel.step.id == step_id],
step_id=step_id,
)
return [message.to_pydantic() for message in messages]