fix: merge issue

This commit is contained in:
tanzhenxin 2025-09-17 19:52:12 +08:00
parent 50199288ec
commit de468f0525

View file

@ -80,7 +80,7 @@ export const AgentExecutionDisplay: React.FC<AgentExecutionDisplayProps> = ({
childWidth, childWidth,
config, config,
}) => { }) => {
const [displayMode, setDisplayMode] = React.useState<DisplayMode>('default'); const [displayMode, setDisplayMode] = React.useState<DisplayMode>('compact');
const agentColor = useMemo(() => { const agentColor = useMemo(() => {
const colorOption = COLOR_OPTIONS.find( const colorOption = COLOR_OPTIONS.find(
@ -133,6 +133,21 @@ export const AgentExecutionDisplay: React.FC<AgentExecutionDisplayProps> = ({
if (displayMode === 'compact') { if (displayMode === 'compact') {
return ( return (
<Box flexDirection="column"> <Box flexDirection="column">
{/* Header: Agent name and status */}
{!data.pendingConfirmation && (
<Box flexDirection="row">
<Text bold color={agentColor}>
{data.subagentName}
</Text>
<StatusDot status={data.status} />
<StatusIndicator status={data.status} />
</Box>
)}
{/* Running state: Show current tool call and progress */}
{data.status === 'running' && (
<>
{/* Current tool call */}
{data.toolCalls && data.toolCalls.length > 0 && ( {data.toolCalls && data.toolCalls.length > 0 && (
<Box flexDirection="column"> <Box flexDirection="column">
<ToolCallItem <ToolCallItem
@ -143,8 +158,8 @@ export const AgentExecutionDisplay: React.FC<AgentExecutionDisplayProps> = ({
{data.toolCalls.length > 1 && !data.pendingConfirmation && ( {data.toolCalls.length > 1 && !data.pendingConfirmation && (
<Box flexDirection="row" paddingLeft={4}> <Box flexDirection="row" paddingLeft={4}>
<Text color={Colors.Gray}> <Text color={Colors.Gray}>
+{data.toolCalls.length - 1} more tool calls{' '} +{data.toolCalls.length - 1} more tool calls (ctrl+r to
{data.status === 'running' ? '(ctrl+r to expand)' : ''} expand)
</Text> </Text>
</Box> </Box>
)} )}
@ -164,6 +179,28 @@ export const AgentExecutionDisplay: React.FC<AgentExecutionDisplayProps> = ({
/> />
</Box> </Box>
)} )}
</>
)}
{/* Completed state: Show summary line */}
{data.status === 'completed' && data.executionSummary && (
<Box flexDirection="row" marginTop={1}>
<Text color={theme.text.secondary}>
Execution Summary: {data.executionSummary.totalToolCalls} tool
uses · {data.executionSummary.totalTokens.toLocaleString()} tokens
· {fmtDuration(data.executionSummary.totalDurationMs)}
</Text>
</Box>
)}
{/* Failed/Cancelled state: Show error reason */}
{data.status === 'failed' && (
<Box flexDirection="row" marginTop={1}>
<Text color={theme.status.error}>
Failed: {data.terminateReason}
</Text>
</Box>
)}
</Box> </Box>
); );
} }