The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 24, 10:15 UTC
refactor(server): remove test-only pricing normalizer (#10017)
Julius Marminge committed
Sep 5, 2026 at 00:28 UTC
270e021f2a7ed34e3d81d1cdc9f1ca0c0ac85df4
2 files changed
-15
apps/server/src/usage/usagePricing.test.ts
-5
@@ -4,7 +4,6 @@ import {
4
cacheSavingsUsd,
5
createOverrideRateTable,
6
lookupRate,
7
- normalizeModelName,
7
parseRateTable,
8
priceUsage,
9
} from "./usagePricing.ts";
@@ -83,10 +82,6 @@ describe("usage pricing", () => {
82
}
83
});
84
86
- it("keeps the existing model-name normalization contract", () => {
87
- expect(normalizeModelName(" Anthropic/Claude-Opus-5 ")).toBe("claude-opus-5");
88
- });
89
-
85
it("keeps the canonical Fable rate separate from DeepInfra in either order", () => {
86
const canonical = ["claude-fable-5", rate(1e-5, 1e-6)] as const;
87
const deepInfra = ["deepinfra/anthropic/claude-fable-5", rate(1e-5)] as const;
apps/server/src/usage/usagePricing.ts
-10
@@ -127,16 +127,6 @@ function normalizeRateKey(model: string): string {
127
return model.trim().toLowerCase();
128
}
129
130
-/**
131
- * Canonicalises a model name for lookup.
132
- *
133
- * Strips a `provider/` prefix and lowercases, since transcripts are
134
- * inconsistent about casing.
135
- */
136
-export function normalizeModelName(model: string): string {
137
- return bareModelName(normalizeRateKey(model));
138
-}
139
-
130
function bareModelName(key: string): string {
131
const slash = key.lastIndexOf("/");
132
return slash === -1 ? key : key.slice(slash + 1);