Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:sparkles: AI Agent https://github.com/siyuan-note/siyuan/issues/17797

Danieldff5f20af66a
diff --git a/app/src/layout/dock/AgentChat.ts b/app/src/layout/dock/AgentChat.ts
index 4893d1e8d4..914aceeea1 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();
}