mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
fix: merge issue
This commit is contained in:
@@ -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,35 +133,72 @@ export const AgentExecutionDisplay: React.FC<AgentExecutionDisplayProps> = ({
|
|||||||
if (displayMode === 'compact') {
|
if (displayMode === 'compact') {
|
||||||
return (
|
return (
|
||||||
<Box flexDirection="column">
|
<Box flexDirection="column">
|
||||||
{data.toolCalls && data.toolCalls.length > 0 && (
|
{/* Header: Agent name and status */}
|
||||||
<Box flexDirection="column">
|
{!data.pendingConfirmation && (
|
||||||
<ToolCallItem
|
<Box flexDirection="row">
|
||||||
toolCall={data.toolCalls[data.toolCalls.length - 1]}
|
<Text bold color={agentColor}>
|
||||||
compact={true}
|
{data.subagentName}
|
||||||
/>
|
</Text>
|
||||||
{/* Show count of additional tool calls if there are more than 1 */}
|
<StatusDot status={data.status} />
|
||||||
{data.toolCalls.length > 1 && !data.pendingConfirmation && (
|
<StatusIndicator status={data.status} />
|
||||||
<Box flexDirection="row" paddingLeft={4}>
|
|
||||||
<Text color={Colors.Gray}>
|
|
||||||
+{data.toolCalls.length - 1} more tool calls{' '}
|
|
||||||
{data.status === 'running' ? '(ctrl+r to expand)' : ''}
|
|
||||||
</Text>
|
|
||||||
</Box>
|
|
||||||
)}
|
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Inline approval prompt when awaiting confirmation */}
|
{/* Running state: Show current tool call and progress */}
|
||||||
{data.pendingConfirmation && (
|
{data.status === 'running' && (
|
||||||
<Box flexDirection="column" marginTop={1} paddingLeft={1}>
|
<>
|
||||||
<ToolConfirmationMessage
|
{/* Current tool call */}
|
||||||
confirmationDetails={data.pendingConfirmation}
|
{data.toolCalls && data.toolCalls.length > 0 && (
|
||||||
isFocused={true}
|
<Box flexDirection="column">
|
||||||
availableTerminalHeight={availableHeight}
|
<ToolCallItem
|
||||||
terminalWidth={childWidth}
|
toolCall={data.toolCalls[data.toolCalls.length - 1]}
|
||||||
compactMode={true}
|
compact={true}
|
||||||
config={config}
|
/>
|
||||||
/>
|
{/* Show count of additional tool calls if there are more than 1 */}
|
||||||
|
{data.toolCalls.length > 1 && !data.pendingConfirmation && (
|
||||||
|
<Box flexDirection="row" paddingLeft={4}>
|
||||||
|
<Text color={Colors.Gray}>
|
||||||
|
+{data.toolCalls.length - 1} more tool calls (ctrl+r to
|
||||||
|
expand)
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Inline approval prompt when awaiting confirmation */}
|
||||||
|
{data.pendingConfirmation && (
|
||||||
|
<Box flexDirection="column" marginTop={1} paddingLeft={1}>
|
||||||
|
<ToolConfirmationMessage
|
||||||
|
confirmationDetails={data.pendingConfirmation}
|
||||||
|
isFocused={true}
|
||||||
|
availableTerminalHeight={availableHeight}
|
||||||
|
terminalWidth={childWidth}
|
||||||
|
compactMode={true}
|
||||||
|
config={config}
|
||||||
|
/>
|
||||||
|
</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>
|
</Box>
|
||||||
|
|||||||
Reference in New Issue
Block a user