Skip to content

Commit be31a16

Browse files
committed
Fix copy-paste error in metric calculation
1 parent 266b085 commit be31a16

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/shared/getApiMetrics.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,9 @@ export function getApiMetrics(messages: ClineMessage[]) {
7272
// kilocode_change start
7373
if (message.type === "ask" && message.ask === "tool" && message.text) {
7474
const fastApplyResult = safeJsonParse<ClineSayTool>(message.text)?.fastApplyResult
75-
if (fastApplyResult?.tokensIn) {
76-
result.totalTokensIn += fastApplyResult.tokensIn
77-
}
78-
if (fastApplyResult?.tokensOut) {
79-
result.totalTokensIn += fastApplyResult.tokensOut
80-
}
81-
if (fastApplyResult?.cost) {
82-
result.totalTokensIn += fastApplyResult.cost
83-
}
75+
result.totalTokensIn += fastApplyResult?.tokensIn ?? 0
76+
result.totalTokensOut += fastApplyResult?.tokensOut ?? 0
77+
result.totalCost += fastApplyResult?.cost ?? 0
8478
}
8579
// kilocode_change end
8680
}

0 commit comments

Comments
 (0)