From 63e7776351551ecbc946d2ae5d583613604279ea Mon Sep 17 00:00:00 2001 From: Shakker Date: Mon, 11 May 2026 07:23:53 +0100 Subject: [PATCH] test: tighten opencode thinking profile assertions --- .../opencode/provider-policy-api.test.ts | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/extensions/opencode/provider-policy-api.test.ts b/extensions/opencode/provider-policy-api.test.ts index f8b110c84cf..cfd49674189 100644 --- a/extensions/opencode/provider-policy-api.test.ts +++ b/extensions/opencode/provider-policy-api.test.ts @@ -1,16 +1,6 @@ import { describe, expect, it } from "vitest"; import { resolveThinkingProfile } from "./provider-policy-api.js"; -function collectLegacyExtendedLevelIds(levels: readonly { id: string }[] | undefined): string[] { - const ids: string[] = []; - for (const level of levels ?? []) { - if (level.id === "xhigh" || level.id === "max") { - ids.push(level.id); - } - } - return ids; -} - describe("opencode provider policy public artifact", () => { it("exposes Claude Opus 4.7 thinking levels without loading the full provider plugin", () => { expect( @@ -18,8 +8,17 @@ describe("opencode provider policy public artifact", () => { provider: "opencode", modelId: "claude-opus-4-7", }), - ).toMatchObject({ - levels: expect.arrayContaining([{ id: "xhigh" }, { id: "adaptive" }, { id: "max" }]), + ).toEqual({ + levels: [ + { id: "off" }, + { id: "minimal" }, + { id: "low" }, + { id: "medium" }, + { id: "high" }, + { id: "xhigh" }, + { id: "adaptive" }, + { id: "max" }, + ], defaultLevel: "off", }); }); @@ -30,10 +29,16 @@ describe("opencode provider policy public artifact", () => { modelId: "claude-opus-4-6", }); - expect(profile).toMatchObject({ - levels: expect.arrayContaining([{ id: "adaptive" }]), + expect(profile).toEqual({ + levels: [ + { id: "off" }, + { id: "minimal" }, + { id: "low" }, + { id: "medium" }, + { id: "high" }, + { id: "adaptive" }, + ], defaultLevel: "adaptive", }); - expect(collectLegacyExtendedLevelIds(profile.levels)).toStrictEqual([]); }); });