






















@@ -1,25 +1,24 @@
11import { describe, expect, it } from "vitest";
22import { resolveThinkingProfile } from "./provider-policy-api.js";
334-function collectLegacyExtendedLevelIds(levels: readonly { id: string }[] | undefined): string[] {
5-const ids: string[] = [];
6-for (const level of levels ?? []) {
7-if (level.id === "xhigh" || level.id === "max") {
8-ids.push(level.id);
9-}
10-}
11-return ids;
12-}
13-144describe("opencode provider policy public artifact", () => {
155it("exposes Claude Opus 4.7 thinking levels without loading the full provider plugin", () => {
166expect(
177resolveThinkingProfile({
188provider: "opencode",
199modelId: "claude-opus-4-7",
2010}),
21-).toMatchObject({
22-levels: expect.arrayContaining([{ id: "xhigh" }, { id: "adaptive" }, { id: "max" }]),
11+).toEqual({
12+levels: [
13+{ id: "off" },
14+{ id: "minimal" },
15+{ id: "low" },
16+{ id: "medium" },
17+{ id: "high" },
18+{ id: "xhigh" },
19+{ id: "adaptive" },
20+{ id: "max" },
21+],
2322defaultLevel: "off",
2423});
2524});
@@ -30,10 +29,16 @@ describe("opencode provider policy public artifact", () => {
3029modelId: "claude-opus-4-6",
3130});
323133-expect(profile).toMatchObject({
34-levels: expect.arrayContaining([{ id: "adaptive" }]),
32+expect(profile).toEqual({
33+levels: [
34+{ id: "off" },
35+{ id: "minimal" },
36+{ id: "low" },
37+{ id: "medium" },
38+{ id: "high" },
39+{ id: "adaptive" },
40+],
3541defaultLevel: "adaptive",
3642});
37-expect(collectLegacyExtendedLevelIds(profile.levels)).toStrictEqual([]);
3843});
3944});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。