Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
feat(autopilots): show execution log button for run-only autopilot runs (#1901)
Jiayuan Zhang65f6e9c9f29c
diff --git a/packages/views/autopilots/components/autopilot-detail-page.tsx b/packages/views/autopilots/components/autopilot-detail-page.tsxindex 57f972616d..54862f7460 100644--- a/packages/views/autopilots/components/autopilot-detail-page.tsx+++ b/packages/views/autopilots/components/autopilot-detail-page.tsx@@ -44,7 +44,9 @@ import {} from "./trigger-config";import type { TriggerConfig } from "./trigger-config";import type { AutopilotExecutionMode, AutopilotRun, AutopilotTrigger } from "@multica/core/types";+import type { AgentTask } from "@multica/core/types/agent";import { ReadonlyContent } from "../../editor";+import { TranscriptButton } from "../../common/task-transcript";import { AutopilotDialog } from "./autopilot-dialog";function formatDate(date: string): string {@@ -63,11 +65,34 @@ const RUN_STATUS_CONFIG: Record<string, { label: string; color: string; icon: tyfailed: { label: "Failed", color: "text-destructive", icon: XCircle },};-function RunRow({ run }: { run: AutopilotRun }) {+function RunRow({ run, agentId, agentName }: { run: AutopilotRun; agentId: string; agentName: string }) {const wsPaths = useWorkspacePaths();const cfg = (RUN_STATUS_CONFIG[run.status] ?? RUN_STATUS_CONFIG["issue_created"])!;const StatusIcon = cfg.icon;+ // For runs with a task_id (run_only mode), build a minimal AgentTask so+ // TranscriptButton can lazy-load the execution transcript.+ const syntheticTask: AgentTask | null = run.task_id+ ? {+ id: run.task_id,+ agent_id: agentId,+ runtime_id: "",+ issue_id: "",+ status:+ run.status === "running" ? "running" :+ run.status === "completed" ? "completed" :+ run.status === "failed" ? "failed" :+ "queued",+ priority: 0,+ dispatched_at: null,+ started_at: run.triggered_at || null,+ completed_at: run.completed_at || null,+ result: null,+ error: run.failure_reason || null,+ created_at: run.created_at,+ }+ : null;+const content = (<><StatusIcon className={cn("h-4 w-4 shrink-0", cfg.color, cfg.spin && "animate-spin")} />@@ -83,6 +108,14 @@ function RunRow({ run }: { run: AutopilotRun }) {<span className="w-32 shrink-0 text-right text-xs text-muted-foreground tabular-nums">{formatDate(run.triggered_at || run.created_at)}</span>+ {syntheticTask && !run.issue_id && (+ <TranscriptButton+ task={syntheticTask}+ agentName={agentName}+ isLive={run.status === "running"}+ title="View execution log"+ />+ )}</>);@@ -438,7 +471,7 @@ export function AutopilotDetailPage({ autopilotId }: { autopilotId: string }) {) : (<div className="rounded-md border overflow-hidden">{runs.map((run) => (- <RunRow key={run.id} run={run} />+ <RunRow key={run.id} run={run} agentId={autopilot.assignee_id} agentName={getActorName("agent", autopilot.assignee_id)} />))}</div>)}