From 71c29c8fe047a8abfbf25cbb909d4aaedd8e5881 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Mon, 27 Apr 2026 17:15:56 +0900 Subject: [PATCH] fix(model-capabilities): disable thinking for minimax and non-thinking kimi Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- src/shared/model-capabilities.test.ts | 55 +++++++++++++++++++ src/shared/model-capability-heuristics.ts | 9 +++ .../model-settings-compatibility.test.ts | 43 +++++++++++++++ 3 files changed, 107 insertions(+) diff --git a/src/shared/model-capabilities.test.ts b/src/shared/model-capabilities.test.ts index e79448fbf..8483f7f56 100644 --- a/src/shared/model-capabilities.test.ts +++ b/src/shared/model-capabilities.test.ts @@ -59,6 +59,12 @@ describe("getModelCapabilities", () => { output: 128_000, }, }, + "minimax-m2.7": { + id: "minimax-m2.7", + family: "minimax", + reasoning: true, + temperature: true, + }, }, } @@ -325,6 +331,55 @@ describe("getModelCapabilities", () => { }) }) + test("marks MiniMax M2.7 as not supporting thinking despite snapshot reasoning", () => { + // given + const modelID = "minimax-m2.7" + + // when + const result = getModelCapabilities({ + providerID: "volcengine", + modelID, + bundledSnapshot, + }) + + // then + expect(result.supportsThinking).toBe(false) + expect(result.diagnostics.supportsThinking.source).toBe("heuristic") + }) + + test("marks non-thinking Kimi K2.6 as not supporting thinking", () => { + // given + const modelID = "kimi-k2.6" + + // when + const result = getModelCapabilities({ + providerID: "volcengine", + modelID, + bundledSnapshot, + }) + + // then + expect(result.supportsThinking).toBe(false) + expect(result.diagnostics.supportsThinking.source).toBe("heuristic") + }) + + test("keeps thinking-flavored Kimi K2.6 models as supporting thinking", () => { + // given + const modelID = "kimi-k2.6-thinking" + + // when + const result = getModelCapabilities({ + providerID: "volcengine", + modelID, + bundledSnapshot, + }) + + // then + expect(result.supportsThinking).toBe(true) + expect(result.family).toBe("kimi-thinking") + expect(result.diagnostics.supportsThinking.source).toBe("heuristic") + }) + test("detects prefixed o-series model IDs through the heuristic fallback", () => { const result = getModelCapabilities({ providerID: "azure-openai", diff --git a/src/shared/model-capability-heuristics.ts b/src/shared/model-capability-heuristics.ts index 374c185ea..d1eba7dd7 100644 --- a/src/shared/model-capability-heuristics.ts +++ b/src/shared/model-capability-heuristics.ts @@ -44,10 +44,18 @@ export const HEURISTIC_MODEL_FAMILY_REGISTRY: ReadonlyArray { @@ -467,6 +468,48 @@ describe("resolveCompatibleModelSettings", () => { ]) }) + test("drops thinking for MiniMax M2.7 capabilities resolved from heuristics", () => { + // given + const capabilities = getModelCapabilities({ + providerID: "volcengine", + modelID: "minimax-m2.7", + }) + + // when + const result = resolveCompatibleModelSettings({ + providerID: "volcengine", + modelID: "minimax-m2.7", + desired: { thinking: { type: "enabled", budgetTokens: 4096 } }, + capabilities, + }) + + // then + expect(result.thinking).toBeUndefined() + expect(result.changes[0]?.field).toBe("thinking") + expect(result.changes[0]?.reason).toBe("unsupported-by-model-metadata") + }) + + test("drops thinking for non-thinking Kimi K2.6 capabilities resolved from heuristics", () => { + // given + const capabilities = getModelCapabilities({ + providerID: "volcengine", + modelID: "kimi-k2.6", + }) + + // when + const result = resolveCompatibleModelSettings({ + providerID: "volcengine", + modelID: "kimi-k2.6", + desired: { thinking: { type: "enabled", budgetTokens: 4096 } }, + capabilities, + }) + + // then + expect(result.thinking).toBeUndefined() + expect(result.changes[0]?.field).toBe("thinking") + expect(result.changes[0]?.reason).toBe("unsupported-by-model-metadata") + }) + test("clamps maxTokens to the model output limit", () => { const result = resolveCompatibleModelSettings({ providerID: "openai",