From 12a21808f99b62657d0a742fd84678ede30ec2a3 Mon Sep 17 00:00:00 2001 From: MT-Mint <798521692@qq.com> Date: Thu, 16 Apr 2026 10:03:37 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=A2=84=E7=95=99=E7=A9=BA?= =?UTF-8?q?=E4=BD=8D=EF=BC=8C=E5=85=88=E5=88=A0=E9=99=A4=E6=97=A7=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E5=86=8D=E9=87=8D=E6=96=B0=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/app/workspace/chats/[thread_id]/page.tsx | 9 +++++++++ frontend/src/core/threads/hooks.ts | 1 + 2 files changed, 10 insertions(+) diff --git a/frontend/src/app/workspace/chats/[thread_id]/page.tsx b/frontend/src/app/workspace/chats/[thread_id]/page.tsx index 254e6191..04c16730 100644 --- a/frontend/src/app/workspace/chats/[thread_id]/page.tsx +++ b/frontend/src/app/workspace/chats/[thread_id]/page.tsx @@ -141,6 +141,15 @@ export default function ChatPage() { if (initializedThreadRef.current === safeThreadId) return; initializedThreadRef.current = safeThreadId; void apiClient.threads + // TODO: 先注释先删除再创建的逻辑 + // .delete(safeThreadId) + // .catch(() => undefined) + // .then(() => + // apiClient.threads.create({ + // threadId: safeThreadId, + // ifExists: "raise", + // }), + // ) .create({ threadId: safeThreadId, ifExists: "do_nothing", diff --git a/frontend/src/core/threads/hooks.ts b/frontend/src/core/threads/hooks.ts index 72558a4d..a007599c 100644 --- a/frontend/src/core/threads/hooks.ts +++ b/frontend/src/core/threads/hooks.ts @@ -678,6 +678,7 @@ export function useSubmitThread({ await apiClient.threads.create({ threadId, ifExists: "do_nothing", + // ifExists: "raise", }); }