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())

View File

@@ -170,7 +170,6 @@ async def deploy_script(
script_id=script_id,
file_count=len(data.files) if data.files else 0,
)
raise HTTPException(status_code=400, detail="Not implemented")
try:
# Get the latest version of the script
@@ -259,7 +258,6 @@ async def run_script(
current_org: Organization = Depends(org_auth_service.get_current_org),
) -> None:
"""Run a script."""
raise HTTPException(status_code=400, detail="Not implemented")
# await script_service.execute_script(
# script_id=script_id,
# organization_id=current_org.organization_id,

View File

@@ -1197,8 +1197,8 @@ class WorkflowService:
screenshot_urls = await app.ARTIFACT_MANAGER.get_share_links(screenshot_artifacts)
recording_url = None
recording_artifact = await app.DATABASE.get_artifact_for_workflow_run(
workflow_run_id=workflow_run_id,
recording_artifact = await app.DATABASE.get_artifact_for_run(
run_id=task_v2.observer_cruise_id if task_v2 else workflow_run_id,
artifact_type=ArtifactType.RECORDING,
organization_id=organization_id,
)