From 4f20205aba5df8b9e191995ea663ff8bc412f047 Mon Sep 17 00:00:00 2001 From: thzxx Date: Sat, 27 Jun 2026 23:03:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BF=AD=E4=BB=A3=E8=AE=A1=E6=95=B0?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E5=8D=A1=E4=BD=8F=20=E2=80=94=20=E5=8F=91?= =?UTF-8?q?=E6=B6=88=E6=81=AF/=E5=88=87=E6=8D=A2=E4=BC=9A=E8=AF=9D?= =?UTF-8?q?=E6=97=B6=E9=87=8D=E7=BD=AE=E4=B8=BA0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/agent-store.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stores/agent-store.ts b/src/stores/agent-store.ts index 41663da..c991c82 100644 --- a/src/stores/agent-store.ts +++ b/src/stores/agent-store.ts @@ -128,7 +128,7 @@ export const useAgentStore = create((set, get) => ({ // ===== Actions ===== setCurrentSession: (id) => { - set({ currentSessionId: id, messages: [], traceSteps: [], tokenUsage: { inputTokens: 0, outputTokens: 0, totalTokens: 0 } }); + set({ currentSessionId: id, messages: [], traceSteps: [], currentIteration: 0, tokenUsage: { inputTokens: 0, outputTokens: 0, totalTokens: 0 } }); // 从数据库加载该会话的消息 if (id && window.metona?.sessions?.getMessages) { @@ -206,6 +206,7 @@ export const useAgentStore = create((set, get) => ({ agentStatus: 'thinking', isStreaming: true, streamingContent: '', + currentIteration: 0, })); // 自动更新会话标题为用户第一条消息