From dff5f20af66ae4cb1eb75b74879fca89d63f1fcb Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sun, 7 Jun 2026 18:22:03 +0800 Subject: [PATCH] :sparkles: AI Agent https://github.com/siyuan-note/siyuan/issues/17797 Signed-off-by: Daniel <845765@qq.com> --- app/src/layout/dock/AgentChat.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/layout/dock/AgentChat.ts b/app/src/layout/dock/AgentChat.ts index 4893d1e8d..914aceeea 100644 --- a/app/src/layout/dock/AgentChat.ts +++ b/app/src/layout/dock/AgentChat.ts @@ -977,11 +977,11 @@ export class AgentChat extends Model { bubble.classList.remove("agent-chat__bubble--streaming"); } this.addCopyButton(this.currentAIElement); + this.flushThinkingStep(); this.entries.push({type: "assistant", content: this.currentContent || " ", toolCalls: this.currentToolCalls.length > 0 ? this.currentToolCalls.slice() : undefined}); this.currentAIElement = null; this.currentContent = ""; this.fullContent = ""; - this.flushThinkingStep(); this.currentToolCalls = []; if (this.requestStartTime) { this.sessionTotalDuration += Date.now() - this.requestStartTime; @@ -1066,6 +1066,7 @@ export class AgentChat extends Model { if (bubble) { bubble.classList.remove("agent-chat__bubble--streaming"); } + this.flushThinkingStep(); if (this.currentContent) { this.entries.push({type: "assistant", content: this.currentContent || " ", toolCalls: this.currentToolCalls.length > 0 ? this.currentToolCalls.slice() : undefined}); } @@ -1080,7 +1081,6 @@ export class AgentChat extends Model { } this.updateTokenDisplay(); this.setStreaming(false); - this.flushThinkingStep(); this.saveSession(); }