Require friendly names for live catalog models
Co-authored-by: Simon Shi <simonsmh@users.noreply.github.com>
This commit is contained in:
co-authored by
Simon Shi
parent
10ab666f31
commit
dc8b9afad2
@@ -75,6 +75,27 @@ describe("Qoder model cache", () => {
|
||||
expect(getCachedModelConfig("qfmodel", "global")).toBeNull();
|
||||
});
|
||||
|
||||
it("omits catalog entries without a friendly display name", async () => {
|
||||
vi.stubGlobal(
|
||||
"fetch",
|
||||
vi.fn().mockResolvedValue({
|
||||
ok: true,
|
||||
json: () =>
|
||||
Promise.resolve({
|
||||
chat: [
|
||||
{ key: "q37fmodel", enable: true },
|
||||
{ key: "qfmodel", enable: true, display_name: "Qwen3.8-Flash" },
|
||||
],
|
||||
}),
|
||||
}),
|
||||
);
|
||||
|
||||
await updateQoderModelsCache("access-token", "user-id", "Test User", "test@example.com", "global");
|
||||
|
||||
expect(getCachedModels("global").map((model) => model.id)).toEqual(["Qwen3.8-Flash"]);
|
||||
expect(getCachedModelConfig("q37fmodel", "global")).toBeNull();
|
||||
});
|
||||
|
||||
it("keeps only enabled service models without adding auto as a fallback", async () => {
|
||||
vi.stubGlobal(
|
||||
"fetch",
|
||||
|
||||
Reference in New Issue
Block a user