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 <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -44,10 +44,18 @@ export const HEURISTIC_MODEL_FAMILY_REGISTRY: ReadonlyArray<HeuristicModelFamily
|
||||
includes: ["gemini"],
|
||||
variants: ["low", "medium", "high"],
|
||||
},
|
||||
{
|
||||
family: "kimi-thinking",
|
||||
includes: ["kimi-thinking", "k2-thinking", "k2-think"],
|
||||
pattern: /(?:kimi|k2).*-(?:thinking|think)/,
|
||||
variants: ["low", "medium", "high"],
|
||||
supportsThinking: true,
|
||||
},
|
||||
{
|
||||
family: "kimi",
|
||||
includes: ["kimi", "k2"],
|
||||
variants: ["low", "medium", "high"],
|
||||
supportsThinking: false,
|
||||
},
|
||||
{
|
||||
family: "glm",
|
||||
@@ -58,6 +66,7 @@ export const HEURISTIC_MODEL_FAMILY_REGISTRY: ReadonlyArray<HeuristicModelFamily
|
||||
family: "minimax",
|
||||
includes: ["minimax"],
|
||||
variants: ["low", "medium", "high"],
|
||||
supportsThinking: false,
|
||||
},
|
||||
{
|
||||
family: "deepseek",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { describe, expect, test } from "bun:test"
|
||||
|
||||
import { getModelCapabilities } from "./model-capabilities"
|
||||
import { resolveCompatibleModelSettings } from "./model-settings-compatibility"
|
||||
|
||||
describe("resolveCompatibleModelSettings", () => {
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user