diff --git a/app/src/layout/dock/AgentChat.ts b/app/src/layout/dock/AgentChat.ts index 8f629a6f5..432e6d675 100644 --- a/app/src/layout/dock/AgentChat.ts +++ b/app/src/layout/dock/AgentChat.ts @@ -754,7 +754,9 @@ export class AgentChat extends Model { this.sessionTotalDuration += Date.now() - this.requestStartTime; this.requestStartTime = 0; } + this.updateTokenDisplay(); this.setStreaming(false); + // line 754 area if (!this.hasTitled && this.messages.length >= 2) { this.hasTitled = true; this.generateTitle(); @@ -773,9 +775,10 @@ export class AgentChat extends Model { this.currentToolCalls = []; if (this.requestStartTime) { this.sessionTotalDuration += Date.now() - this.requestStartTime; - this.requestStartTime = 0; - } - this.setStreaming(false); + this.requestStartTime = 0; + } + this.updateTokenDisplay(); + this.setStreaming(false); if (!this.hasTitled && this.messages.length >= 2) { this.hasTitled = true; @@ -851,9 +854,10 @@ export class AgentChat extends Model { } if (this.requestStartTime) { this.sessionTotalDuration += Date.now() - this.requestStartTime; - this.requestStartTime = 0; - } - this.setStreaming(false); + this.requestStartTime = 0; + } + this.updateTokenDisplay(); + this.setStreaming(false); } private insertBeforeAI(el: HTMLElement) { @@ -878,7 +882,7 @@ export class AgentChat extends Model { '