From db915a239d369d87d43ca67339a9275d8ed0122f Mon Sep 17 00:00:00 2001 From: Yichen Jiang Date: Thu, 22 Oct 2026 11:25:35 +0800 Subject: [PATCH] test(llm-deepseek-api-key): pin the once-per-listing hidden-entry diagnostic --- packages/llm/llm-deepseek-api-key/tests/listing.spec.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/llm/llm-deepseek-api-key/tests/listing.spec.ts b/packages/llm/llm-deepseek-api-key/tests/listing.spec.ts index c5f9c16eaf..9bfd1bf07c 100644 --- a/packages/llm/llm-deepseek-api-key/tests/listing.spec.ts +++ b/packages/llm/llm-deepseek-api-key/tests/listing.spec.ts @@ -85,10 +85,15 @@ it('falls back to the built-in catalog when the listing fails', async () => { }) it('refuses listed models this build cannot serve before any inference request', async () => { - const requests = officialListing(listing(FLASH, { ...PRO, id: 'deepseek-v5' }, { ...PRO, id: 'deepseek-v5-next', ...requires('99.0.0-alpha.1') })) - const { ctx } = await host() + const requests = officialListing(listing( + FLASH, { ...PRO, id: 'deepseek-v5' }, { ...PRO, id: 'deepseek-v5-next', ...requires('99.0.0-alpha.1') }, { id: 'deepseek-v4-pro' }, + )) + const { ctx, warn } = await host() await ctx.plugin(ApiKey, {}) expect(await ids(ctx)).toEqual(['deepseek-flash']) + expect(await ids(ctx)).toEqual(['deepseek-flash']) + expect(warn).toHaveBeenCalledExactlyOnceWith('[llm-deepseek-api-key]', 'model "deepseek-v4-pro" declares no api_capabilities.anthropic_messages') + await expect(ctx.llm.prepareCall({ provider: 'deepseek-official', model: 'deepseek-v4-pro' })).rejects.toMatchObject({ code: 'MODEL_UNSUPPORTED' }) await expect(ctx.llm.prepareCall({ provider: 'deepseek-official', model: 'deepseek-v5' })).rejects.toMatchObject({ code: 'MODEL_UNSUPPORTED' }) await expect(ctx.llm.prepareCall({ provider: 'deepseek-official', model: 'deepseek-v5-next' })).rejects.toMatchObject({ code: 'CLIENT_UPGRADE_REQUIRED' }) await expect(ctx.llm.prepareCall({ provider: 'deepseek-official', model: 'unlisted-pass-through' })).resolves.toBeDefined()