fix(stats): normalize routed model ids (#43582)
Co-authored-by: thdxr <thdxr@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
be469f328c
commit
5ccb1e88e1
@@ -9,6 +9,7 @@ describe("inference stat normalization", () => {
|
||||
expect(normalizeInferenceModel("mimo-v2.5-free")).toBe("mimo-v2.5")
|
||||
expect(normalizeInferenceModel("nemotron-3-super-free")).toBe("nemotron-3-super")
|
||||
expect(normalizeInferenceModel("mimo-v2.5-free:global")).toBe("mimo-v2.5")
|
||||
expect(normalizeInferenceModel("hy3-preview:free")).toBe("hy3-preview")
|
||||
})
|
||||
|
||||
test("maps normalized model ids to public authors", () => {
|
||||
@@ -31,6 +32,7 @@ describe("inference stat normalization", () => {
|
||||
test("uses provider.model to resolve opencode route providers", () => {
|
||||
expect(statModel("big-pickle", "claude-sonnet-4-5")).toBe("claude-sonnet-4-5")
|
||||
expect(statModel("big-pickle", "gpt-5-free")).toBe("gpt-5")
|
||||
expect(statModel("big-pickle", "xiaomi/mimo-v2.5")).toBe("mimo-v2.5")
|
||||
expect(statModel("big-pickle", "")).toBe("unknown")
|
||||
expect(statProvider("big-pickle", "claude-sonnet-4-5", "opencode")).toBe("anthropic")
|
||||
expect(statProvider("big-pickle", "gpt-5", "opencode")).toBe("openai")
|
||||
@@ -100,6 +102,7 @@ describe("inference stat normalization", () => {
|
||||
expect(queries[0]).toContain("AND (product = 'go' OR (lower(COALESCE(model_tier, '')) = 'free'")
|
||||
expect(queries[0]).toContain("COALESCE(NULLIF(lower(model_tier), ''), '') AS raw_tier")
|
||||
expect(queries[0]).toContain("WHEN lower(COALESCE(raw_tier, '')) = 'free'")
|
||||
expect(queries[0]).toContain("regexp_replace(NULLIF(route_model, ''), '^.*/', '')")
|
||||
expect(queries[0]).toContain("OR lower(raw_model) IN ('gpt-5-nano', 'grok-code', 'big-pickle')")
|
||||
expect(queries[0]).toContain("OR lower(raw_model) LIKE '%-free'")
|
||||
expect(queries[0]).toContain("THEN 'Free'")
|
||||
|
||||
Reference in New Issue
Block a user