diff --git a/src/core/task/index.ts b/src/core/task/index.ts index 620f5778..4b8d7906 100644 --- a/src/core/task/index.ts +++ b/src/core/task/index.ts @@ -2960,6 +2960,20 @@ export class Task { } } + // Update UI with final usage after stream is complete + await updateApiReqMsg({ + messageStateHandler: this.messageStateHandler, + lastApiReqIndex, + inputTokens, + outputTokens, + cacheWriteTokens, + cacheReadTokens, + api: this.api, + totalCost, + }) + await this.messageStateHandler.saveClineMessagesAndUpdateHistory() + await this.postStateToWebview() + // Finalize any remaining tool calls at the end of the stream if (this.useNativeToolCalls) { // For native tool calls, mark all pending tool uses as complete