fix(model-settings): apply reasoning aliases with capabilities
This commit is contained in:
@@ -359,6 +359,29 @@ describe("resolveCompatibleModelSettings", () => {
|
||||
}
|
||||
})
|
||||
|
||||
test("DeepSeek maps generic reasoningEffort levels when capabilities come from heuristics", () => {
|
||||
const capabilities = getModelCapabilities({
|
||||
providerID: "openai-compatible",
|
||||
modelID: "deepseek-v4-pro",
|
||||
})
|
||||
const result = resolveCompatibleModelSettings({
|
||||
providerID: "openai-compatible",
|
||||
modelID: "deepseek-v4-pro",
|
||||
desired: { reasoningEffort: "xhigh" },
|
||||
capabilities,
|
||||
})
|
||||
|
||||
expect(result.reasoningEffort).toBe("max")
|
||||
expect(result.changes).toEqual([
|
||||
{
|
||||
field: "reasoningEffort",
|
||||
from: "xhigh",
|
||||
to: "max",
|
||||
reason: "unsupported-by-model-family",
|
||||
},
|
||||
])
|
||||
})
|
||||
|
||||
test("GPT-5 downgrades unsupported max variant to xhigh", () => {
|
||||
const result = resolveCompatibleModelSettings({
|
||||
providerID: "openai",
|
||||
|
||||
@@ -88,6 +88,11 @@ function resolveField(
|
||||
metadataOverride?: string[],
|
||||
familyAliases?: Record<string, string>,
|
||||
): FieldResolution {
|
||||
const aliased = familyAliases?.[normalized]
|
||||
if (aliased && (metadataOverride?.includes(aliased) || familyCaps?.includes(aliased))) {
|
||||
return { value: aliased, reason: "unsupported-by-model-family" }
|
||||
}
|
||||
|
||||
if (metadataOverride) {
|
||||
if (metadataOverride.includes(normalized)) return { value: normalized }
|
||||
return {
|
||||
@@ -98,10 +103,6 @@ function resolveField(
|
||||
|
||||
if (familyCaps) {
|
||||
if (familyCaps.includes(normalized)) return { value: normalized }
|
||||
const aliased = familyAliases?.[normalized]
|
||||
if (aliased && familyCaps.includes(aliased)) {
|
||||
return { value: aliased, reason: "unsupported-by-model-family" }
|
||||
}
|
||||
return {
|
||||
value: downgradeWithinLadder(normalized, familyCaps, ladder),
|
||||
reason: "unsupported-by-model-family",
|
||||
|
||||
Reference in New Issue
Block a user