diff --git a/codex-cli/src/components/chat/terminal-chat-response-item.tsx b/codex-cli/src/components/chat/terminal-chat-response-item.tsx index 8e7ab4d8..4b7e069f 100644 --- a/codex-cli/src/components/chat/terminal-chat-response-item.tsx +++ b/codex-cli/src/components/chat/terminal-chat-response-item.tsx @@ -72,30 +72,13 @@ export function TerminalChatResponseReasoning({ }: { message: ResponseReasoningItem & { duration_ms?: number }; }): React.ReactElement | null { - // prefer the real duration if present - const thinkingTime = message.duration_ms - ? Math.round(message.duration_ms / 1000) - : Math.max( - 1, - Math.ceil( - (message.summary || []) - .map((t) => t.text.length) - .reduce((a, b) => a + b, 0) / 300, - ), - ); - if (thinkingTime <= 0) { + // Only render when there is a reasoning summary + if (!message.summary || message.summary.length === 0) { return null; } - return ( - - - thinking - - for {thinkingTime}s - - {message.summary?.map((summary, key) => { + {message.summary.map((summary, key) => { const s = summary as { headline?: string; text: string }; return ( diff --git a/codex-cli/src/components/chat/terminal-message-history.tsx b/codex-cli/src/components/chat/terminal-message-history.tsx index 0e283591..07c3ac37 100644 --- a/codex-cli/src/components/chat/terminal-message-history.tsx +++ b/codex-cli/src/components/chat/terminal-message-history.tsx @@ -30,16 +30,14 @@ const MessageHistory: React.FC = ({ thinkingSeconds, fullStdout, }) => { - const [messages, debug] = useMemo( - () => [batch.map(({ item }) => item!), process.env["DEBUG"]], - [batch], - ); + // Flatten batch entries to response items. + const messages = useMemo(() => batch.map(({ item }) => item!), [batch]); return ( - {loading && debug && ( + {loading && ( - {`(${thinkingSeconds}s)`} + {`thinking for ${thinkingSeconds}s`} )} @@ -48,8 +46,13 @@ const MessageHistory: React.FC = ({ return ; } - // After the guard above `item` can only be a ResponseItem. + // After the guard above, item is a ResponseItem const message = item as ResponseItem; + // Suppress empty reasoning updates (i.e. items with an empty summary). + const msg = message as unknown as { summary?: Array }; + if (msg.summary?.length === 0) { + return null; + } return (