diff --git a/extensions/copilot/src/usage-bridge.test.ts b/extensions/copilot/src/usage-bridge.test.ts index 680b07088e24..cb67cbf3cdbf 100644 --- a/extensions/copilot/src/usage-bridge.test.ts +++ b/extensions/copilot/src/usage-bridge.test.ts @@ -3,7 +3,6 @@ import type { NormalizedUsage } from "openclaw/plugin-sdk/agent-harness-runtime" import { describe, expect, it } from "vitest"; import { buildCopilotAssistantUsage, - deriveCopilotUsageTotal, normalizeCopilotUsage, } from "./usage-bridge.js"; @@ -251,21 +250,4 @@ describe("usage-bridge", () => { }); }); - describe("deriveCopilotUsageTotal", () => { - it("returns undefined when usage is undefined", () => { - expect(deriveCopilotUsageTotal(undefined)).toBeUndefined(); - }); - - it("sums input/output/cacheRead/cacheWrite for total", () => { - const usage: NormalizedUsage = { - cacheRead: 3, - cacheWrite: 4, - input: 1, - output: 2, - total: 999, - }; - - expect(deriveCopilotUsageTotal(usage)).toBe(10); - }); - }); }); diff --git a/extensions/copilot/src/usage-bridge.ts b/extensions/copilot/src/usage-bridge.ts index 2fadfdb38336..2d98659d758c 100644 --- a/extensions/copilot/src/usage-bridge.ts +++ b/extensions/copilot/src/usage-bridge.ts @@ -72,13 +72,3 @@ export function buildCopilotAssistantUsage(params: { totalTokens: usage?.total ?? 0, }; } - -export function deriveCopilotUsageTotal(usage?: NormalizedUsage): number | undefined { - if (!usage) { - return undefined; - } - - return ( - (usage.input ?? 0) + (usage.output ?? 0) + (usage.cacheRead ?? 0) + (usage.cacheWrite ?? 0) - ); -}