Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/opencode/src/provider/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ export function variants(model: Provider.Model): Record<string, Record<string, a
id.includes("glm") ||
(id.includes("mistral") && model.api.npm !== "@ai-sdk/mistral") ||
id.includes("kimi") ||
id.includes("k2p5") ||
id.includes("k2p") ||
Comment thread
Astro-Han marked this conversation as resolved.
id.includes("qwen") ||
id.includes("big-pickle")
)
Expand Down Expand Up @@ -1154,11 +1154,11 @@ export function options(input: {
}
}

// Enable thinking by default for kimi-k2.5/k2p5 models using anthropic SDK
// Enable thinking by default for kimi models using anthropic SDK
const modelId = input.model.api.id.toLowerCase()
if (
(input.model.api.npm === "@ai-sdk/anthropic" || input.model.api.npm === "@ai-sdk/google-vertex/anthropic") &&
(modelId.includes("k2p5") || modelId.includes("kimi-k2.5") || modelId.includes("kimi-k2p5"))
(modelId.includes("k2p") || modelId.includes("kimi-k2.") || modelId.includes("kimi-k2p"))
Comment thread
Astro-Han marked this conversation as resolved.
) {
result["thinking"] = {
type: "enabled",
Expand Down
8 changes: 4 additions & 4 deletions packages/opencode/test/provider/transform.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,8 @@ describe("ProviderTransform.options - Kimi anthropic thinking", () => {
headers: {},
}) as any

test("enables thinking for the supported Kimi K2.5 anthropic variants", () => {
for (const apiId of ["kimi-k2.5", "kimi-k2p5", "k2p5"]) {
test("enables thinking for supported Kimi K2.x anthropic variants", () => {
for (const apiId of ["kimi-k2.5", "kimi-k2p5", "k2p5", "kimi-k2.6", "kimi-k2p6", "k2p6"]) {
const result = ProviderTransform.options({
model: createModel(apiId),
sessionID,
Expand All @@ -493,8 +493,8 @@ describe("ProviderTransform.options - Kimi anthropic thinking", () => {
}
})

test("does not broaden thinking to unrelated Kimi K2 or K2P variants", () => {
for (const apiId of ["kimi-k2.6", "kimi-k2-preview", "kimi-k2p6", "k2p6"]) {
test("does not enable thinking for Kimi variants that lack a K2 dot or K2P tag", () => {
for (const apiId of ["kimi-k2-preview", "kimi-k2", "kimi-k2-thinking"]) {
const result = ProviderTransform.options({
model: createModel(apiId),
sessionID,
Expand Down