mirror of
https://github.com/earendil-works/pi.git
synced 2026-10-02 00:35:27 +08:00
fix(ai): update tests for removed OpenCode Go Kimi K2.6
models.dev dropped Kimi K2.6 from OpenCode Go, which broke type checks against the regenerated catalog. Use OpenCode Go Kimi K3 for provider-level tests and OpenCode Zen Kimi K2.6 for thinking format tests.
This commit is contained in:
@@ -510,7 +510,6 @@ describe("Cache Retention (PI_CACHE_RETENTION)", () => {
|
||||
MODELS.opencode["kimi-k2.5"],
|
||||
MODELS.opencode["kimi-k2.6"],
|
||||
MODELS.opencode["minimax-m2.7"],
|
||||
MODELS["opencode-go"]["kimi-k2.6"],
|
||||
] as const)("should omit long cache retention for $provider/$id", async (metadata) => {
|
||||
const model = metadata as Model<"openai-completions">;
|
||||
let capturedPayload: OpenAICompletionsCachePayload | undefined;
|
||||
|
||||
@@ -1320,7 +1320,7 @@ describe("openai-completions tool_choice", () => {
|
||||
},
|
||||
];
|
||||
|
||||
const { compat: _compat, ...baseModel } = getModel("opencode-go", "kimi-k2.6")!;
|
||||
const { compat: _compat, ...baseModel } = getModel("opencode-go", "kimi-k3")!;
|
||||
const model = { ...baseModel, api: "openai-completions" } as const;
|
||||
const response = await streamSimple(
|
||||
model,
|
||||
@@ -1367,7 +1367,7 @@ describe("openai-completions tool_choice", () => {
|
||||
});
|
||||
|
||||
it("replays OpenCode Go reasoning thinking blocks as reasoning_content", () => {
|
||||
const { compat: _compat, ...baseModel } = getModel("opencode-go", "kimi-k2.6")!;
|
||||
const { compat: _compat, ...baseModel } = getModel("opencode-go", "kimi-k3")!;
|
||||
const model = { ...baseModel, api: "openai-completions" } as Model<"openai-completions">;
|
||||
const messages = convertMessages(
|
||||
model,
|
||||
@@ -1377,7 +1377,7 @@ describe("openai-completions tool_choice", () => {
|
||||
role: "assistant",
|
||||
api: "openai-completions",
|
||||
provider: "opencode-go",
|
||||
model: "kimi-k2.6",
|
||||
model: "kimi-k3",
|
||||
content: [
|
||||
{ type: "thinking", thinking: "think", thinkingSignature: "reasoning" },
|
||||
{ type: "toolCall", id: "call_1", name: "read", arguments: { path: "README.md" } },
|
||||
@@ -1425,8 +1425,8 @@ describe("openai-completions tool_choice", () => {
|
||||
expect(messages[0]).not.toHaveProperty("reasoning");
|
||||
});
|
||||
|
||||
it("sends thinking disabled for OpenCode Go Kimi K2.6 when thinking is off", async () => {
|
||||
const model = getModel("opencode-go", "kimi-k2.6")!;
|
||||
it("sends thinking disabled for OpenCode Kimi K2.6 when thinking is off", async () => {
|
||||
const model = getModel("opencode", "kimi-k2.6")!;
|
||||
let payload: unknown;
|
||||
|
||||
await streamSimple(
|
||||
@@ -1447,8 +1447,8 @@ describe("openai-completions tool_choice", () => {
|
||||
expect(params.reasoning_effort).toBeUndefined();
|
||||
});
|
||||
|
||||
it("sends thinking enabled for OpenCode Go Kimi K2.6 when thinking is enabled", async () => {
|
||||
const model = getModel("opencode-go", "kimi-k2.6")!;
|
||||
it("sends thinking enabled for OpenCode Kimi K2.6 when thinking is enabled", async () => {
|
||||
const model = getModel("opencode", "kimi-k2.6")!;
|
||||
let payload: unknown;
|
||||
|
||||
await streamSimple(
|
||||
@@ -1519,7 +1519,7 @@ describe("openai-completions tool_choice", () => {
|
||||
});
|
||||
|
||||
it("sends max_tokens for OpenCode completions models", async () => {
|
||||
const cases = [getModel("opencode-go", "kimi-k2.6")!, getModel("opencode", "kimi-k2.6")!] as const;
|
||||
const cases = [getModel("opencode-go", "kimi-k3")!, getModel("opencode", "kimi-k2.6")!] as const;
|
||||
|
||||
for (const model of cases) {
|
||||
let payload: unknown;
|
||||
|
||||
@@ -159,12 +159,6 @@ describe("getSupportedThinkingLevels", () => {
|
||||
expect(getSupportedThinkingLevels(model!)).toEqual(["low", "high", "max"]);
|
||||
});
|
||||
|
||||
it("includes only high plus off for OpenCode Go Kimi K2.6", () => {
|
||||
const model = getModel("opencode-go", "kimi-k2.6");
|
||||
expect(model).toBeDefined();
|
||||
expect(getSupportedThinkingLevels(model!)).toEqual(["off", "high"]);
|
||||
});
|
||||
|
||||
it("excludes thinking off for Moonshot Kimi K2.7 Code models", () => {
|
||||
const cases = [getModel("moonshotai", "kimi-k2.7-code"), getModel("moonshotai-cn", "kimi-k2.7-code")];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user