diff --git a/app/routers/runs.py b/app/routers/runs.py index 958e223..078f0df 100644 --- a/app/routers/runs.py +++ b/app/routers/runs.py @@ -100,15 +100,16 @@ async def get_run( if not run: raise HTTPException(404, f"Run {run_id} not found") - if wants_json(request): - return run + # Only render HTML if browser explicitly requests it + if wants_html(request): + templates = get_templates(request) + return render(templates, "runs/detail.html", request, + run=run, + active_tab="runs", + ) - # Render HTML detail page - templates = get_templates(request) - return render(templates, "runs/detail.html", request, - run=run, - active_tab="runs", - ) + # Default to JSON for API clients + return run @router.delete("/{run_id}")