diff --git a/frontend/src/app/workspace/chats/[thread_id]/page.tsx b/frontend/src/app/workspace/chats/[thread_id]/page.tsx index c54180a0..a538fb90 100644 --- a/frontend/src/app/workspace/chats/[thread_id]/page.tsx +++ b/frontend/src/app/workspace/chats/[thread_id]/page.tsx @@ -135,10 +135,16 @@ export default function ChatPage() { setHistoryCutoff(null); return; } - if (historyCutoff === null && !thread.isThreadLoading) { - setHistoryCutoff(thread.messages.length); - } + if (hasSubmitted) return; + // Welcome 态下、未提交前,把当前已有消息都当作“历史”切掉。 + // 这样即使历史消息是后续异步补齐,也不会重新露出。 + setHistoryCutoff((prev) => { + const next = thread.messages.length; + if (prev === null) return next; + return next > prev ? next : prev; + }); }, [ + hasSubmitted, historyCutoff, shouldRenderHistory, thread.isThreadLoading, @@ -331,9 +337,11 @@ export default function ChatPage() { threadId={threadId} thread={thread} messagesOverride={ - shouldRenderHistory || historyCutoff === null + shouldRenderHistory ? undefined - : thread.messages.slice(historyCutoff) + : historyCutoff === null + ? [] + : thread.messages.slice(historyCutoff) } paddingBottom={todoListCollapsed ? 160 : 280} showScrollToBottomButton={!showWelcomeStyle}