Skip to content

Commit 986221a

Browse files
authored
fix(app): keep models with unknown release dates visible (#60496)
1 parent a6212cb commit 986221a

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎packages/app/src/runtime/server/global-sync/utils.test.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ describe("normalizeAgentList", () => {
4141
})
4242

4343
describe("normalizeProviderList", () => {
44-
test("groups current models into the app provider catalog", () => {
44+
test.each([
45+
[0, ""],
46+
[Date.UTC(2026, 8, 1), "2026-09-01"],
47+
])("groups models with release time %p into the app catalog", (released, release_date) => {
4548
const providers: ProviderListOutput["data"] = [
4649
{ id: "openai", name: "OpenAI", activation: "auto", package: "@ai-sdk/openai" },
4750
]
@@ -54,7 +57,7 @@ describe("normalizeProviderList", () => {
5457
name: "GPT-5",
5558
capabilities: { tools: true, input: ["text", "image"], output: ["text"] },
5659
variants: [{ id: "high" }],
57-
time: { released: 1 },
60+
time: { released },
5861
cost: [{ input: 1, output: 2, cache: { read: 0.1, write: 0.2 } }],
5962
status: "active",
6063
enabled: true,
@@ -83,6 +86,7 @@ describe("normalizeProviderList", () => {
8386
expect(result.all.get("openai")?.models["gpt-5"]).toMatchObject({
8487
id: "gpt-5",
8588
providerID: "openai",
89+
release_date,
8690
capabilities: { toolcall: true, attachment: true, reasoning: true },
8791
cost: { input: 1, output: 2 },
8892
variants: { high: {} },

‎packages/app/src/runtime/server/global-sync/utils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export function normalizeProviderList(
119119
status: model.status,
120120
options: model.settings ?? {},
121121
headers: model.headers ?? {},
122-
release_date: new Date(model.time.released).toISOString().slice(0, 10),
122+
release_date: model.time.released === 0 ? "" : new Date(model.time.released).toISOString().slice(0, 10),
123123
variants: Object.fromEntries(model.variants.map((variant) => [variant.id, variant.settings ?? {}])),
124124
}
125125
}

0 commit comments

Comments
 (0)