fix(ui): surface model retry status (NAN-34) (#5504)

This commit is contained in:
chengyongru authored and GitHub committed 2026-09-07 15:12:39 +08:00
1 parent 0b1fa0c3e4
commit b581a496a6
52 files changed
+1697 -55

No files matched your search

+14 -2
View File
@@ -4,7 +4,7 @@ import { MessageBubble } from "@/components/MessageBubble";
import { AgentActivityCluster } from "@/components/thread/AgentActivityCluster";
import { AssistantSelectionAction } from "@/components/thread/AssistantSelectionAction";
import { projectActivityTimeline, type TurnUnit } from "@/lib/activity-timeline";
import type { CliAppInfo, McpPresetInfo, SlashCommand, UIMessage } from "@/lib/types";
import type { CliAppInfo, McpPresetInfo, RetryStatus, SlashCommand, UIMessage } from "@/lib/types";
interface ThreadMessagesProps {
messages: UIMessage[];
@@ -14,6 +14,7 @@ interface ThreadMessagesProps {
activeTurnId?: string | null;
/** Optimistic or canonical active-turn start, in unix seconds. */
runStartedAt?: number | null;
retryStatus?: RetryStatus | null;
hiddenUserMessageCount?: number;
cliApps?: CliAppInfo[];
mcpPresets?: McpPresetInfo[];
@@ -63,6 +64,7 @@ export function ThreadMessages({
isStreaming = false,
activeTurnId = null,
runStartedAt = null,
retryStatus = null,
hiddenUserMessageCount = 0,
cliApps = [],
mcpPresets = [],
@@ -97,7 +99,7 @@ export function ThreadMessages({
isStreaming
&& liveActivityClusterIndices.size === 0
&& pendingTurn !== null
&& !pendingTurn.hasVisibleOutput
&& (retryStatus !== null || !pendingTurn.hasVisibleOutput)
) ? pendingTurn : null;
const currentTurnStartIndex = isStreaming
? activeTurnStartIndex(units, activeTurnId)
@@ -161,6 +163,11 @@ export function ThreadMessages({
: index > currentTurnStartIndex
)
}
retryStatus={
unit.type === "activity" && liveActivityClusterIndices.has(index)
? retryStatus
: null
}
forkIndex={forkIndex}
showForkBoundary={index === forkBoundaryAfterUnitIndex}
forkBoundaryLabel={t("thread.forkedFromHistory")}
@@ -179,6 +186,7 @@ export function ThreadMessages({
messages={[]}
isTurnStreaming
hasBodyBelow={false}
retryStatus={retryStatus}
startedAtMs={
runStartedAt != null
? runStartedAt * 1000
@@ -243,6 +251,7 @@ interface ThreadDisplayUnitProps {
hasBodyBelow: boolean;
deferOffscreenRender: boolean;
isTurnStreaming: boolean;
retryStatus: RetryStatus | null;
forkIndex?: number;
showForkBoundary: boolean;
forkBoundaryLabel: string;
@@ -262,6 +271,7 @@ const ThreadDisplayUnit = memo(function ThreadDisplayUnit({
hasBodyBelow,
deferOffscreenRender,
isTurnStreaming,
retryStatus,
forkIndex,
showForkBoundary,
forkBoundaryLabel,
@@ -293,6 +303,7 @@ const ThreadDisplayUnit = memo(function ThreadDisplayUnit({
<AgentActivityCluster
messages={unit.messages}
isTurnStreaming={isTurnStreaming}
retryStatus={retryStatus}
hasBodyBelow={hasBodyBelow}
turnLatencyMs={unit.turnLatencyMs}
startedAtMs={unit.startedAtMs}
@@ -329,6 +340,7 @@ function threadDisplayUnitPropsEqual(
&& previous.hasBodyBelow === next.hasBodyBelow
&& previous.deferOffscreenRender === next.deferOffscreenRender
&& previous.isTurnStreaming === next.isTurnStreaming
&& previous.retryStatus === next.retryStatus
&& previous.forkIndex === next.forkIndex
&& previous.showForkBoundary === next.showForkBoundary
&& previous.forkBoundaryLabel === next.forkBoundaryLabel