fix(autoCombo): fallback to base model intelligence for -free alias models (#8601) (#8662)

When looking up models_dev_tier or capability scores for -free alias models (e.g. deepseek-v4-flash-free), strip the -free suffix to query the underlying model's intelligence data if direct lookup yields null.

Co-authored-by: Austin Liu <austinliu@Austins-MacBook-Air-3.local>
Co-authored-by: diegosouzapw <diegosouzapw@users.noreply.github.com>
This commit is contained in:
Austin Liu
2026-07-28 05:54:14 +09:30
committed by GitHub
parent 13e15e9cfe
commit 6ca33ef58a

View File

@@ -0,0 +1,24 @@
import { describe, it, expect } from "vitest";
import {
getModelsDevTierFitness,
getTaskFitnessWithSource,
} from "../../../open-sse/services/autoCombo/taskFitness.js";
describe("models_dev_tier free-alias fallback (#8601)", () => {
it("should return fitness score for -free alias from models_dev_tier DB or capabilities fallback", () => {
// Standard model without free suffix should match or resolve
const baseScore = getModelsDevTierFitness("deepseek-v4-flash", "coding");
const freeScore = getModelsDevTierFitness("deepseek-v4-flash-free", "coding");
// If baseScore is resolved (or capability fallback works), freeScore should match baseScore
if (baseScore !== null) {
expect(freeScore).toBe(baseScore);
}
});
it("getTaskFitnessWithSource should fall back for models_dev_tier / arena_elo on -free models", () => {
const res = getTaskFitnessWithSource("deepseek-v4-flash-free", "coding");
expect(res).not.toBeNull();
expect(typeof res.score).toBe("number");
});
});