diff --git a/app/routers/runs.py b/app/routers/runs.py index 471ff9f..9c61ea7 100644 --- a/app/routers/runs.py +++ b/app/routers/runs.py @@ -140,10 +140,30 @@ async def get_run( except Exception as e: logger.warning(f"Failed to load recipe for plan: {e}") + # Build artifacts list from output and inputs + artifacts = [] + if run.get("output_hash"): + # Detect media type + output_hash = run["output_hash"] + media_type = None + try: + cache_path = get_cache_manager().get_path(output_hash) + if cache_path and cache_path.exists(): + import mimetypes + media_type, _ = mimetypes.guess_type(str(cache_path)) + except Exception: + pass + artifacts.append({ + "hash": output_hash, + "step_name": "Output", + "media_type": media_type or "application/octet-stream", + }) + templates = get_templates(request) return render(templates, "runs/detail.html", request, run=run, plan=plan, + artifacts=artifacts, active_tab="runs", )