The open-source app everyone uses to manage agents at work
TypeScript acpxagent-orchestrationagent-skillsagentic-aiai-agentsai-engineeringai-governanceai-toolsautonomous-agentsclaudeclaude-codeclaude-skillscodexhermesllmmcpmulti-agentopenclawproject-managementworkflow-automation
Render sandbox runtime status in issue threads (#8594)
Devin Foley800dab1c6482
diff --git a/ui/src/api/heartbeats.ts b/ui/src/api/heartbeats.tsindex c556748984..9153bc4503 100644--- a/ui/src/api/heartbeats.ts+++ b/ui/src/api/heartbeats.ts@@ -36,6 +36,8 @@ export interface ActiveRunForIssue {lastUsefulActionAt?: string | Date | null;nextAction?: string | null;outputSilence?: HeartbeatRun["outputSilence"];+ currentStatusMessage?: string | null;+ currentStatusUpdatedAt?: string | Date | null;}export interface LiveRunForIssue {@@ -60,6 +62,8 @@ export interface LiveRunForIssue {lastUsefulActionAt?: string | null;nextAction?: string | null;outputSilence?: HeartbeatRun["outputSilence"];+ currentStatusMessage?: string | null;+ currentStatusUpdatedAt?: string | null;}export interface WatchdogDecisionInput {diff --git a/ui/src/components/IssueChatThread.test.tsx b/ui/src/components/IssueChatThread.test.tsxindex 914f45645f..3c934ba264 100644--- a/ui/src/components/IssueChatThread.test.tsx+++ b/ui/src/components/IssueChatThread.test.tsx@@ -3318,6 +3318,48 @@ describe("IssueChatThread", () => {});});+ it("renders ephemeral active-run status below the working indicator", () => {+ const root = createRoot(container);++ act(() => {+ root.render(+ <MemoryRouter>+ <IssueChatThread+ comments={[]}+ linkedRuns={[]}+ timelineEvents={[]}+ liveRuns={[]}+ activeRun={{+ id: "run-1",+ issueId: "issue-1",+ status: "running",+ invocationSource: "comment",+ triggerDetail: null,+ startedAt: "2026-04-06T12:00:00.000Z",+ finishedAt: null,+ createdAt: "2026-04-06T12:00:00.000Z",+ agentId: "agent-1",+ agentName: "Agent 1",+ adapterType: "codex_local",+ currentStatusMessage: "Syncing git worktree to sandbox",+ currentStatusUpdatedAt: "2026-04-06T12:00:05.000Z",+ }}+ onAdd={async () => {}}+ enableLiveTranscriptPolling={false}+ />+ </MemoryRouter>,+ );+ });++ expect(container.textContent).toContain("Working...");+ expect(container.textContent).toContain("Syncing git worktree to sandbox");+ expect(container.querySelector('[title="Syncing git worktree to sandbox"]')).not.toBeNull();++ act(() => {+ root.unmount();+ });+ });+it("folds chain-of-thought when the same message transitions from running to complete", () => {expect(resolveAssistantMessageFoldedState({messageId: "message-1",diff --git a/ui/src/components/IssueChatThread.tsx b/ui/src/components/IssueChatThread.tsxindex ccccf325a2..f4887e2ba0 100644--- a/ui/src/components/IssueChatThread.tsx+++ b/ui/src/components/IssueChatThread.tsx@@ -874,6 +874,8 @@ function IssueChatChainOfThought({const rawSegments = Array.isArray(custom.chainOfThoughtSegments)? (custom.chainOfThoughtSegments as SegmentTiming[]): [];+ const currentStatusMessage =+ typeof custom.currentStatusMessage === "string" ? custom.currentStatusMessage.trim() : "";const segmentTiming = myIndex >= 0 ? rawSegments[myIndex] ?? null : null;const isActive = isCoTSegmentActive({isMessageRunning,@@ -908,33 +910,45 @@ function IssueChatChainOfThought({<div><buttontype="button"- className="group flex w-full items-center gap-2.5 rounded-lg px-1 py-2 text-left transition-colors hover:bg-accent/5"+ className="group flex w-full items-start gap-2.5 rounded-lg px-1 py-2 text-left transition-colors hover:bg-accent/5"onClick={() => hasContent && setExpanded((v) => !v)}>- <span className="inline-flex items-center gap-2 text-sm font-medium text-foreground/80">- {agentIcon ? (- <AgentIcon icon={agentIcon} className="h-4 w-4 shrink-0" />- ) : isActive ? (- <Loader2 className="h-4 w-4 shrink-0 animate-spin text-muted-foreground" />- ) : (- <span className="flex h-4 w-4 shrink-0 items-center justify-center">- <span className="h-1.5 w-1.5 rounded-full bg-emerald-500/70" />+ <div className="min-w-0 flex-1">+ <div className="flex min-w-0 items-center gap-2.5">+ <span className="inline-flex items-center gap-2 text-sm font-medium text-foreground/80">+ {agentIcon ? (+ <AgentIcon icon={agentIcon} className="h-4 w-4 shrink-0" />+ ) : isActive ? (+ <Loader2 className="h-4 w-4 shrink-0 animate-spin text-muted-foreground" />+ ) : (+ <span className="flex h-4 w-4 shrink-0 items-center justify-center">+ <span className="h-1.5 w-1.5 rounded-full bg-emerald-500/70" />+ </span>+ )}+ {isActive ? (+ <span className="shimmer-text">{headerVerb}</span>+ ) : (+ headerVerb+ )}</span>- )}- {isActive ? (- <span className="shimmer-text">{headerVerb}</span>- ) : (- headerVerb- )}- </span>- {headerSuffix ? (- <span className="text-xs text-muted-foreground/60">{headerSuffix}</span>- ) : null}- {toolSummary ? (- <span className="text-xs text-muted-foreground/40">· {toolSummary}</span>- ) : null}+ {headerSuffix ? (+ <span className="text-xs text-muted-foreground/60">{headerSuffix}</span>+ ) : null}+ {toolSummary ? (+ <span className="text-xs text-muted-foreground/40">· {toolSummary}</span>+ ) : null}+ </div>+ {isActive && currentStatusMessage ? (+ <span+ className="mt-0.5 block truncate pl-6 text-xs leading-4 text-muted-foreground/70"+ title={currentStatusMessage}+ >+ {currentStatusMessage}+ </span>+ ) : null}+ </div>{hasContent ? (- <ChevronDown className={cn("ml-auto h-4 w-4 shrink-0 text-muted-foreground/50 transition-transform", expanded && "rotate-180")} />+ <ChevronDown className={cn("mt-0.5 h-4 w-4 shrink-0 text-muted-foreground/50 transition-transform", expanded && "rotate-180")} />) : null}</button>{expanded && hasContent ? (@@ -1579,6 +1593,8 @@ function IssueChatAssistantMessage({? custom.notices.filter((notice): notice is string => typeof notice === "string" && notice.length > 0): [];const waitingText = typeof custom.waitingText === "string" ? custom.waitingText : "";+ const currentStatusMessage =+ typeof custom.currentStatusMessage === "string" ? custom.currentStatusMessage.trim() : "";const isRunning = message.role === "assistant" && message.status?.type === "running";const runHref = runId && runAgentId ? `/agents/${runAgentId}/runs/${runId}` : null;const canStopRun = Boolean(runId) && (isRunActive || runStatus === "queued" || runStatus === "running");@@ -1855,15 +1871,25 @@ function IssueChatAssistantMessage({<div className="space-y-3"><IssueChatAssistantParts message={message} hasCoT={hasCoT} />{message.content.length === 0 && waitingText ? (- <div className="flex items-center gap-2.5 rounded-lg px-1 py-2">- <span className="inline-flex items-center gap-2 text-sm font-medium text-foreground/80">- {agentIcon ? (- <AgentIcon icon={agentIcon} className="h-4 w-4 shrink-0" />- ) : (- <Loader2 className="h-4 w-4 shrink-0 animate-spin text-muted-foreground" />- )}- <span className="shimmer-text">{waitingText}</span>- </span>+ <div className="rounded-lg px-1 py-2">+ <div className="flex min-w-0 items-center gap-2.5">+ <span className="inline-flex items-center gap-2 text-sm font-medium text-foreground/80">+ {agentIcon ? (+ <AgentIcon icon={agentIcon} className="h-4 w-4 shrink-0" />+ ) : (+ <Loader2 className="h-4 w-4 shrink-0 animate-spin text-muted-foreground" />+ )}+ <span className="shimmer-text">{waitingText}</span>+ </span>+ </div>+ {isRunning && currentStatusMessage ? (+ <div+ className="mt-0.5 truncate pl-6 text-xs leading-4 text-muted-foreground/70"+ title={currentStatusMessage}+ >+ {currentStatusMessage}+ </div>+ ) : null}</div>) : null}{notices.length > 0 ? (@@ -4178,6 +4204,8 @@ export function IssueChatThread({adapterType: activeRun.adapterType,logBytes: activeRun.logBytes,lastOutputBytes: activeRun.lastOutputBytes,+ currentStatusMessage: activeRun.currentStatusMessage ?? null,+ currentStatusUpdatedAt: toIsoString(activeRun.currentStatusUpdatedAt),});}return [...deduped.values()].sort((a, b) => new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime());diff --git a/ui/src/lib/issue-chat-messages.test.ts b/ui/src/lib/issue-chat-messages.test.tsindex 8d1147edac..de7849a825 100644--- a/ui/src/lib/issue-chat-messages.test.ts+++ b/ui/src/lib/issue-chat-messages.test.ts@@ -13,7 +13,7 @@ import type {SuggestTasksInteraction,} from "./issue-thread-interactions";import type { IssueTimelineEvent } from "./issue-timeline-events";-import type { LiveRunForIssue } from "../api/heartbeats";+import type { ActiveRunForIssue, LiveRunForIssue } from "../api/heartbeats";function createAgent(id: string, name: string): Agent {return {@@ -640,6 +640,46 @@ describe("buildIssueChatMessages", () => {});});+ it("preserves ephemeral active-run status metadata for rendering", () => {+ const activeRun: ActiveRunForIssue = {+ id: "run-active-1",+ status: "running",+ invocationSource: "manual",+ triggerDetail: null,+ startedAt: "2026-04-06T12:03:00.000Z",+ finishedAt: null,+ createdAt: "2026-04-06T12:03:00.000Z",+ agentId: "agent-1",+ agentName: "CodexCoder",+ adapterType: "codex_local",+ currentStatusMessage: "Syncing git worktree to sandbox",+ currentStatusUpdatedAt: "2026-04-06T12:03:05.000Z",+ };++ const messages = buildIssueChatMessages({+ comments: [],+ timelineEvents: [],+ linkedRuns: [],+ liveRuns: [],+ activeRun,+ currentUserId: "user-1",+ });++ expect(messages).toHaveLength(1);+ expect(messages[0]).toMatchObject({+ role: "assistant",+ status: { type: "running" },+ metadata: {+ custom: {+ kind: "live-run",+ runId: "run-active-1",+ currentStatusMessage: "Syncing git worktree to sandbox",+ currentStatusUpdatedAt: "2026-04-06T12:03:05.000Z",+ },+ },+ });+ });+it("places request confirmations after later same-run handoff status and comment", () => {const messages = buildIssueChatMessages({comments: [diff --git a/ui/src/lib/issue-chat-messages.ts b/ui/src/lib/issue-chat-messages.tsindex 4993cd709e..3a3dcfe9e6 100644--- a/ui/src/lib/issue-chat-messages.ts+++ b/ui/src/lib/issue-chat-messages.ts@@ -857,6 +857,10 @@ function normalizeLiveRuns(agentName: activeRun.agentName,adapterType: activeRun.adapterType,issueId,+ currentStatusMessage: activeRun.currentStatusMessage ?? null,+ currentStatusUpdatedAt: activeRun.currentStatusUpdatedAt+ ? toDate(activeRun.currentStatusUpdatedAt).toISOString()+ : null,});}return [...deduped.values()].sort((a, b) => toTimestamp(a.createdAt) - toTimestamp(b.createdAt));@@ -895,6 +899,8 @@ function createLiveRunMessage(args: {waitingText,chainOfThoughtLabel: runDurationLabel(run),chainOfThoughtSegments: segments,+ currentStatusMessage: run.currentStatusMessage ?? null,+ currentStatusUpdatedAt: run.currentStatusUpdatedAt ?? null,}),};return message;