From 95ffe9fa695c9c7cd1807f803a4d8da10c11bc50 Mon Sep 17 00:00:00 2001 From: gilesb Date: Sun, 11 Jan 2026 21:56:08 +0000 Subject: [PATCH] Fix run detail page and recipe name - Render HTML template for run detail (not just JSON) - Get recipe name from pending_runs instead of hardcoding "dag" Co-Authored-By: Claude Opus 4.5 --- app/routers/runs.py | 14 ++++++++++++-- legacy_tasks.py | 6 ++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/routers/runs.py b/app/routers/runs.py index f7c84e7..958e223 100644 --- a/app/routers/runs.py +++ b/app/routers/runs.py @@ -89,8 +89,9 @@ async def create_run( return run -@router.get("/{run_id}", response_model=RunStatus) +@router.get("/{run_id}") async def get_run( + request: Request, run_id: str, run_service: RunService = Depends(get_run_service), ): @@ -98,7 +99,16 @@ async def get_run( run = await run_service.get_run(run_id) if not run: raise HTTPException(404, f"Run {run_id} not found") - return run + + if wants_json(request): + return run + + # Render HTML detail page + templates = get_templates(request) + return render(templates, "runs/detail.html", request, + run=run, + active_tab="runs", + ) @router.delete("/{run_id}") diff --git a/legacy_tasks.py b/legacy_tasks.py index fe26f42..5d6908c 100644 --- a/legacy_tasks.py +++ b/legacy_tasks.py @@ -383,16 +383,18 @@ def execute_dag(self, dag_json: str, run_id: str = None) -> dict: if (node.node_type == NodeType.SOURCE or str(node.node_type) == "SOURCE") and node.config.get("content_hash") ] - # Get actor_id from pending_runs (saved when run started) + # Get actor_id and recipe from pending_runs (saved when run started) actor_id = None + recipe_name = "dag" pending = await database.get_pending_run(run_id) if pending: actor_id = pending.get("actor_id") + recipe_name = pending.get("recipe") or "dag" await database.save_run_cache( run_id=run_id, output_hash=output_hash, - recipe="dag", + recipe=recipe_name, inputs=input_hashes_for_db, ipfs_cid=output_ipfs_cid, actor_id=actor_id,