fix missing recording for task v2 block (#3304)

This commit is contained in:
LawyZheng
2025-08-27 12:08:37 +08:00
committed by GitHub
parent 2e5ebc6427
commit dd21c3a707
3 changed files with 5 additions and 8 deletions

View File

@@ -1245,9 +1245,9 @@ class AgentDB:
LOG.error("UnexpectedError", exc_info=True)
raise
async def get_artifact_for_workflow_run(
async def get_artifact_for_run(
self,
workflow_run_id: str,
run_id: str,
artifact_type: ArtifactType,
organization_id: str | None = None,
) -> Artifact | None:
@@ -1256,8 +1256,7 @@ class AgentDB:
artifact = (
await session.scalars(
select(ArtifactModel)
.join(TaskModel, TaskModel.task_id == ArtifactModel.task_id)
.filter(TaskModel.workflow_run_id == workflow_run_id)
.filter(ArtifactModel.run_id == run_id)
.filter(ArtifactModel.artifact_type == artifact_type)
.filter(ArtifactModel.organization_id == organization_id)
.order_by(ArtifactModel.created_at.desc())