


























@@ -51,35 +51,31 @@ describe("opencode provider plugin", () => {
5151throw new Error("Expected OpenCode provider resolveThinkingProfile");
5252}
535354-expect(
55-resolveThinkingProfile({
56-provider: "opencode",
57-modelId: "claude-opus-4-7",
58-}),
59-).toMatchObject({
60-levels: expect.arrayContaining([{ id: "xhigh" }, { id: "adaptive" }, { id: "max" }]),
61-defaultLevel: "off",
54+const opus47Profile = resolveThinkingProfile({
55+provider: "opencode",
56+modelId: "claude-opus-4-7",
6257});
58+const opus47LevelIds = opus47Profile?.levels.map((level) => level.id) ?? [];
59+expect(opus47Profile?.defaultLevel).toBe("off");
60+expect(opus47LevelIds).toContain("xhigh");
61+expect(opus47LevelIds).toContain("adaptive");
62+expect(opus47LevelIds).toContain("max");
6363const opus46Profile = resolveThinkingProfile({
6464provider: "opencode",
6565modelId: "claude-opus-4.6",
6666});
67-expect(opus46Profile).toMatchObject({
68-levels: expect.arrayContaining([{ id: "adaptive" }]),
69-defaultLevel: "adaptive",
70-});
7167const opus46LevelIds = opus46Profile?.levels.map((level) => level.id) ?? [];
68+expect(opus46Profile?.defaultLevel).toBe("adaptive");
69+expect(opus46LevelIds).toContain("adaptive");
7270expect(opus46LevelIds).not.toContain("xhigh");
7371expect(opus46LevelIds).not.toContain("max");
7472const sonnet46Profile = resolveThinkingProfile({
7573provider: "opencode",
7674modelId: "claude-sonnet-4-6",
7775});
78-expect(sonnet46Profile).toMatchObject({
79-levels: expect.arrayContaining([{ id: "adaptive" }]),
80-defaultLevel: "adaptive",
81-});
8276const sonnet46LevelIds = sonnet46Profile?.levels.map((level) => level.id) ?? [];
77+expect(sonnet46Profile?.defaultLevel).toBe("adaptive");
78+expect(sonnet46LevelIds).toContain("adaptive");
8379expect(sonnet46LevelIds).not.toContain("xhigh");
8480expect(sonnet46LevelIds).not.toContain("max");
8581});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。