Fix undefined completed_count variable in plan visualization

Added completed_count stat for steps executed during run (vs cached_count for
steps already in cache). Also fixed pending_count calculation to account for
completed steps.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
giles
2026-01-11 01:24:22 +00:00
parent b9f8b5538b
commit 3e24156c99

View File

@@ -1474,8 +1474,12 @@ async def run_plan_visualization(run_id: str, request: Request):
# Stats summary - count from built nodes to reflect actual execution status
total = len(nodes)
cached_count = sum(1 for n in nodes if n["data"]["status"] == "cached")
completed_count = sum(1 for n in nodes if n["data"]["status"] == "completed")
running_count = sum(1 for n in nodes if n["data"]["status"] == "running")
pending_count = total - cached_count - running_count
pending_count = total - cached_count - completed_count - running_count
# Plan name for display
plan_name = plan_data.get("recipe", run.recipe.replace("recipe:", ""))
content = f'''
<a href="/runs" class="inline-flex items-center text-blue-400 hover:text-blue-300 mb-6">