Return only standalone tasks, no workflow tasks in /runs (#1716)

This commit is contained in:
Shuchang Zheng 2025-02-04 22:13:36 +08:00 committed by GitHub
parent d34a403c8f
commit 95ee4c6088
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1409,7 +1409,11 @@ class AgentDB:
convert_to_workflow_run(run, debug_enabled=self.debug_enabled) for run in workflow_run_query_result
]
task_query = select(TaskModel).filter(TaskModel.organization_id == organization_id)
task_query = (
select(TaskModel)
.filter(TaskModel.organization_id == organization_id)
.filter(TaskModel.workflow_run_id.is_(None))
)
if status:
task_query = task_query.filter(TaskModel.status.in_(status))
task_query = task_query.order_by(TaskModel.created_at.desc()).limit(limit)