From 0bd2be05e7c373fdfeb17e478ed07d19c44ab570 Mon Sep 17 00:00:00 2001 From: Diego Rodrigues de Sa e Souza Date: Fri, 14 Aug 2026 10:56:56 -0300 Subject: [PATCH] test(api): align duplicate-builtin catalog expectation with the #10248 overlay contract (#10383) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #10248 changed the contract: a custom row for an id that already exists is the operator-owned overlay for that model (catalog.ts:1330) — its explicitly stored fields win over discovered metadata and the merged entry is flagged `custom`. Before #10248 the duplicate was skipped, so the test asserted `custom === false` and started failing. The stale expectation is corrected (not weakened) and an identity assertion is added: the overlay must keep the catalog id rather than becoming a detached entry. models-catalog-route.test.ts: 44 pass, 0 fail (was 43 pass / 1 fail). --- tests/unit/models-catalog-route.test.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/unit/models-catalog-route.test.ts b/tests/unit/models-catalog-route.test.ts index 2db47dbf9c..cebb7cc89d 100644 --- a/tests/unit/models-catalog-route.test.ts +++ b/tests/unit/models-catalog-route.test.ts @@ -1398,8 +1398,15 @@ test("v1 models catalog skips duplicate built-ins and custom models from inactiv const duplicateBuiltins = body.data.filter((item) => item.id === "openai/gpt-4o-2024-11-20"); assert.equal(response.status, 200); + // Still exactly one entry: the custom row overlays the built-in, it does not duplicate it. assert.equal(duplicateBuiltins.length, 1); - assert.equal(duplicateBuiltins[0].custom === true, false); + // #10248 changed the contract: a custom row for an id that already exists is the + // operator-owned overlay for that model (catalog.ts:1330) — its explicitly stored + // fields win over the discovered metadata, and the merged entry is flagged `custom`. + // Before #10248 the duplicate was skipped outright, so this asserted `false`. + assert.equal(duplicateBuiltins[0].custom, true); + // The overlay must keep the catalog identity rather than becoming a detached entry. + assert.equal(duplicateBuiltins[0].id, "openai/gpt-4o-2024-11-20"); assert.equal( body.data.some((item) => item.id === "cl/inactive-only" || item.id === "cline/inactive-only"), false