diff --git a/codex-cli/src/components/chat/terminal-message-history.tsx b/codex-cli/src/components/chat/terminal-message-history.tsx index 5036f0813d..7ccd435aed 100644 --- a/codex-cli/src/components/chat/terminal-message-history.tsx +++ b/codex-cli/src/components/chat/terminal-message-history.tsx @@ -6,7 +6,7 @@ import type { FileOpenerScheme } from "src/utils/config.js"; import TerminalChatResponseItem from "./terminal-chat-response-item.js"; import TerminalHeader from "./terminal-header.js"; -import { Box, Static } from "ink"; +import { Box } from "ink"; import React, { useMemo } from "react"; // A batch entry can either be a standalone response item or a grouped set of @@ -42,50 +42,41 @@ const TerminalMessageHistory: React.FC = ({ return ( - {/* The dedicated thinking indicator in the input area now displays the - elapsed time, so we no longer render a separate counter here. */} - - {(item, index) => { - if (item === "header") { - return ; - } + {/* Render header first so subsequent updates do not cause it to reappear */} + + {messages.map((message, index) => { + // 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; + } - // 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 ( - - - - ); - }} - + return ( + + + + ); + })} ); };