From 136158fe327a027f4ad5f5f35f5fdce5a2802d5e Mon Sep 17 00:00:00 2001 From: Shakker Date: Mon, 11 May 2026 03:15:44 +0100 Subject: [PATCH] test: tighten vercel thinking profile assertions --- extensions/vercel-ai-gateway/thinking.test.ts | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/extensions/vercel-ai-gateway/thinking.test.ts b/extensions/vercel-ai-gateway/thinking.test.ts index 3bc74603c32..cd6b7b33a0e 100644 --- a/extensions/vercel-ai-gateway/thinking.test.ts +++ b/extensions/vercel-ai-gateway/thinking.test.ts @@ -15,6 +15,24 @@ function collectLegacyExtendedLevelIds(levels: readonly { id: string }[] | undef return ids; } +const OPENAI_XHIGH_LEVELS = [ + { id: "off" }, + { id: "minimal" }, + { id: "low" }, + { id: "medium" }, + { id: "high" }, + { id: "xhigh" }, +]; + +const CLAUDE_ADAPTIVE_LEVELS = [ + { id: "off" }, + { id: "minimal" }, + { id: "low" }, + { id: "medium" }, + { id: "high" }, + { id: "adaptive" }, +]; + describe("vercel ai gateway thinking profile", () => { async function getProvider() { const { providers } = await registerProviderPlugin({ @@ -33,7 +51,7 @@ describe("vercel ai gateway thinking profile", () => { modelId: "openai/gpt-5.4", }); - expect(profile?.levels).toEqual(expect.arrayContaining([{ id: "xhigh" }])); + expect(profile).toStrictEqual({ levels: OPENAI_XHIGH_LEVELS }); }); it("exposes Codex xhigh through the OpenAI upstream prefix", async () => { @@ -44,7 +62,7 @@ describe("vercel ai gateway thinking profile", () => { modelId: "openai/gpt-5.3-codex-spark", }); - expect(profile?.levels).toEqual(expect.arrayContaining([{ id: "xhigh" }])); + expect(profile).toStrictEqual({ levels: OPENAI_XHIGH_LEVELS }); }); it("reuses Claude thinking defaults for trusted Anthropic upstream refs", async () => { @@ -55,8 +73,8 @@ describe("vercel ai gateway thinking profile", () => { modelId: "anthropic/claude-opus-4.6", }); - expect(profile).toMatchObject({ - levels: expect.arrayContaining([{ id: "adaptive" }]), + expect(profile).toStrictEqual({ + levels: CLAUDE_ADAPTIVE_LEVELS, defaultLevel: "adaptive", }); expect(collectLegacyExtendedLevelIds(profile?.levels)).toStrictEqual([]);