Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(usage): aggregate transcripts from every provider instance #6603

Closedeffektsvk(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/6603/headopened View on GitHub

Showing 13 changed files with 68 additions and 42 deletions (loading 10).

x
0 of 13 viewed, 13 left
42 additions and 40 deletionsapps/server/src/usage/UsageService.tsModified
View file
@@ -35,8 +35,6 @@
​
import { ServerConfig } from "../config.ts";
import * as ServerSettings from "../serverSettings.ts";
-import { resolveClaudeHomePath } from "../provider/Drivers/ClaudeHome.ts";
-import { resolveCodexHomeLayout } from "../provider/Drivers/CodexHomeLayout.ts";
import { UsageAggregator } from "./usageAggregation.ts";
import { parseRateTable, type RateTable } from "./usagePricing.ts";
import {
@@ -52,6 +50,7 @@
type ScanCache,
} from "./usageScanCache.ts";
import type { UsageRecord } from "./usageTranscripts.ts";
+import { resolveUsageTranscriptSources } from "./usageTranscriptSources.ts";
​
const LITELLM_RATES_URL =
"https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json";
@@ -89,7 +88,10 @@
export class UsageService extends Context.Service<
UsageService,
- readonly readSummary: (input: UsageSummaryInput) => Effect.Effect<UsageSummary, UsageReadError>;
+ readonly readSummary: (
+ input: UsageSummaryInput,
+ workspaceCwds?: readonly string[],
+ ) => Effect.Effect<UsageSummary, UsageReadError>;
>()("t3/usage/UsageService") {}