Don't show debugger runs in workflow run history (#3666)
This commit is contained in:
@@ -1788,7 +1788,12 @@ class AgentDB:
|
|||||||
raise WorkflowRunNotFound(workflow_run_id)
|
raise WorkflowRunNotFound(workflow_run_id)
|
||||||
|
|
||||||
async def get_all_runs(
|
async def get_all_runs(
|
||||||
self, organization_id: str, page: int = 1, page_size: int = 10, status: list[WorkflowRunStatus] | None = None
|
self,
|
||||||
|
organization_id: str,
|
||||||
|
page: int = 1,
|
||||||
|
page_size: int = 10,
|
||||||
|
status: list[WorkflowRunStatus] | None = None,
|
||||||
|
include_debugger_runs: bool = False,
|
||||||
) -> list[WorkflowRun | Task]:
|
) -> list[WorkflowRun | Task]:
|
||||||
try:
|
try:
|
||||||
async with self.Session() as session:
|
async with self.Session() as session:
|
||||||
@@ -1804,6 +1809,10 @@ class AgentDB:
|
|||||||
.filter(WorkflowRunModel.organization_id == organization_id)
|
.filter(WorkflowRunModel.organization_id == organization_id)
|
||||||
.filter(WorkflowRunModel.parent_workflow_run_id.is_(None))
|
.filter(WorkflowRunModel.parent_workflow_run_id.is_(None))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not include_debugger_runs:
|
||||||
|
workflow_run_query = workflow_run_query.filter(WorkflowRunModel.debug_session_id.is_(None))
|
||||||
|
|
||||||
if status:
|
if status:
|
||||||
workflow_run_query = workflow_run_query.filter(WorkflowRunModel.status.in_(status))
|
workflow_run_query = workflow_run_query.filter(WorkflowRunModel.status.in_(status))
|
||||||
workflow_run_query = workflow_run_query.order_by(WorkflowRunModel.created_at.desc()).limit(limit)
|
workflow_run_query = workflow_run_query.order_by(WorkflowRunModel.created_at.desc()).limit(limit)
|
||||||
|
|||||||
Reference in New Issue
Block a user