Add artifacts to run detail view
Build artifacts list from run output_hash and detect media type for display in the artifacts tab. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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",
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user