From f34028368deded84d02cc40d14d3eff6fb2b48a0 Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Mon, 1 Jun 2026 08:34:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=AC=A2=E8=BF=8E=E9=A1=B5=E5=8F=91?= =?UTF-8?q?=E9=80=81=E6=B6=88=E6=81=AF=E5=90=8E=E4=BE=A7=E8=BE=B9=E6=A0=8F?= =?UTF-8?q?=E5=8D=B3=E6=97=B6=E5=88=B7=E6=96=B0=E4=BC=9A=E8=AF=9D=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在 handleSend 中 createConversation 成功后立即调用 invalidateQueries, 同时传入 displayModelId 保持与侧边栏新建会话行为一致。 --- src/web/consoles/workbench/components/chat/ChatPanel.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/web/consoles/workbench/components/chat/ChatPanel.tsx b/src/web/consoles/workbench/components/chat/ChatPanel.tsx index 9a444ff..7d2d5d7 100644 --- a/src/web/consoles/workbench/components/chat/ChatPanel.tsx +++ b/src/web/consoles/workbench/components/chat/ChatPanel.tsx @@ -140,8 +140,9 @@ export function ChatPanel({ conversationId, onConversationCreated, projectId }: if (!conversationId) { try { - const conv = await createConversation(projectId); + const conv = await createConversation(projectId, displayModelId ?? undefined); skipHistoryLoadRef.current = conv.id; + void queryClient.invalidateQueries({ queryKey: ["conversations", projectId] }); void sendMessage({ text }, { body: { conversationId: conv.id } }); onConversationCreated(conv.id); } catch (err: unknown) { @@ -153,7 +154,7 @@ export function ChatPanel({ conversationId, onConversationCreated, projectId }: } void sendMessage({ text }, { body: { conversationId } }); - }, [input, sendMessage, conversationId, projectId, onConversationCreated, message]); + }, [input, sendMessage, conversationId, projectId, onConversationCreated, message, queryClient, displayModelId]); const extractText = useCallback((msg: UIMessage) => { return msg.parts