From 854f637b607ad8e6b91d63fc0d90fa015a4e0249 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Sat, 28 Feb 2026 16:23:53 -0500 Subject: [PATCH] Render stages tab as agent session with compact tool call rows Replace stage list with single-stage agent session view showing system prompt, assistant messages, and grouped tool calls. Tool call/result pairs are combined into compact expandable rows. Co-Authored-By: Claude Opus 4.6 --- apps/arc-web/app/routes/run-stages.tsx | 270 ++++++++++++++++++------- 1 file changed, 192 insertions(+), 78 deletions(-) diff --git a/apps/arc-web/app/routes/run-stages.tsx b/apps/arc-web/app/routes/run-stages.tsx index 80d4ba0fa..0f1ecf58c 100644 --- a/apps/arc-web/app/routes/run-stages.tsx +++ b/apps/arc-web/app/routes/run-stages.tsx @@ -1,70 +1,26 @@ import { useState } from "react"; +import { Link, useParams } from "react-router"; import { ChevronRightIcon } from "@heroicons/react/20/solid"; import { CheckCircleIcon, ArrowPathIcon, PauseCircleIcon, XCircleIcon } from "@heroicons/react/24/solid"; +import { DocumentTextIcon, MapIcon, CommandLineIcon, ChatBubbleLeftIcon, WrenchScrewdriverIcon } from "@heroicons/react/24/outline"; +import { findRun } from "../data/runs"; +import { workflowData } from "./workflow-detail"; + +export const handle = { wide: true }; type StageStatus = "completed" | "running" | "pending" | "failed"; -interface StageEvent { - time: string; - description: string; -} - interface Stage { name: string; status: StageStatus; duration: string; - events: StageEvent[]; } const stages: Stage[] = [ - { - name: "Detect Drift", - status: "completed", - duration: "1m 12s", - events: [ - { time: "0s", description: "Loading environment configs for production and staging" }, - { time: "8s", description: "Diffing infrastructure state files" }, - { time: "24s", description: "Comparing application config values" }, - { time: "45s", description: "Analyzing schema differences" }, - { time: "1m 02s", description: "Drift detected in 3 resources" }, - { time: "1m 12s", description: "Stage completed" }, - ], - }, - { - name: "Propose Changes", - status: "completed", - duration: "2m 34s", - events: [ - { time: "0s", description: "Generating reconciliation plan" }, - { time: "18s", description: "Computing minimal patch for Redis config" }, - { time: "52s", description: "Computing minimal patch for IAM policies" }, - { time: "1m 30s", description: "Computing minimal patch for env variables" }, - { time: "2m 10s", description: "Validating proposed changes against constraints" }, - { time: "2m 34s", description: "Stage completed — 3 patches ready" }, - ], - }, - { - name: "Review Changes", - status: "completed", - duration: "0m 45s", - events: [ - { time: "0s", description: "Presenting changes for review" }, - { time: "0m 32s", description: "All patches approved" }, - { time: "0m 45s", description: "Stage completed" }, - ], - }, - { - name: "Apply Changes", - status: "running", - duration: "1m 58s", - events: [ - { time: "0s", description: "Applying Redis config patch" }, - { time: "22s", description: "Redis config applied successfully" }, - { time: "35s", description: "Applying IAM policy patch" }, - { time: "1m 10s", description: "IAM policy applied successfully" }, - { time: "1m 24s", description: "Applying env variable patch" }, - ], - }, + { name: "Detect Drift", status: "completed", duration: "1m 12s" }, + { name: "Propose Changes", status: "completed", duration: "2m 34s" }, + { name: "Review Changes", status: "completed", duration: "0m 45s" }, + { name: "Apply Changes", status: "running", duration: "1m 58s" }, ]; const statusConfig: Record = { @@ -74,47 +30,205 @@ const statusConfig: Record +
- {open && ( -
- {stage.events.map((event, i) => ( -
- - {event.time} - {event.description} -
- ))} +
+
+
Args
+
{tool.args}
+
+
+
Result
+
{tool.result}
+
)}
); } -export default function RunStages() { +function ToolBlock({ tools }: { tools: ToolUse[] }) { return ( -
- {stages.map((stage) => ( - +
+ {tools.map((tool, i) => ( + ))}
); } + +function SystemBlock({ content }: { content: string }) { + return ( +
+
+ + System Prompt +
+
+
{content}
+
+
+ ); +} + +function AssistantBlock({ content }: { content: string }) { + return ( +
+
+ + Assistant +
+
+
{content}
+
+
+ ); +} + +export default function RunStages() { + const { id } = useParams(); + const run = findRun(id ?? ""); + const workflow = run ? workflowData[run.workflow] : undefined; + const selectedConfig = statusConfig[selectedStage.status]; + const SelectedIcon = selectedConfig.icon; + + return ( +
+ + +
+
+ +

{selectedStage.name}

+ {selectedStage.duration} +
+ + {turns.map((turn, i) => { + switch (turn.kind) { + case "system": + return ; + case "assistant": + return ; + case "tool": + return ; + } + })} +
+
+ ); +}