fix(model-capabilities): honor root thinking flags
This commit is contained in:
@@ -115,6 +115,22 @@ describe("getModelCapabilities", () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test("respects root-level thinking flags when providers do not nest them under capabilities", () => {
|
||||||
|
const result = getModelCapabilities({
|
||||||
|
providerID: "custom-proxy",
|
||||||
|
modelID: "gpt-5.4",
|
||||||
|
runtimeModel: {
|
||||||
|
supportsThinking: true,
|
||||||
|
},
|
||||||
|
bundledSnapshot,
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(result).toMatchObject({
|
||||||
|
canonicalModelID: "gpt-5.4",
|
||||||
|
supportsThinking: true,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
test("accepts runtime variant arrays without corrupting them into numeric keys", () => {
|
test("accepts runtime variant arrays without corrupting them into numeric keys", () => {
|
||||||
const result = getModelCapabilities({
|
const result = getModelCapabilities({
|
||||||
providerID: "openai",
|
providerID: "openai",
|
||||||
|
|||||||
@@ -276,6 +276,11 @@ function readRuntimeModelThinkingSupport(runtimeModel: Record<string, unknown> |
|
|||||||
return capabilityValue
|
return capabilityValue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const rootThinkingSupport = readRuntimeModelBoolean(runtimeModel, ["thinking", "supportsThinking"])
|
||||||
|
if (rootThinkingSupport !== undefined) {
|
||||||
|
return rootThinkingSupport
|
||||||
|
}
|
||||||
|
|
||||||
const runtimeCapabilities = readRuntimeModelCapabilities(runtimeModel)
|
const runtimeCapabilities = readRuntimeModelCapabilities(runtimeModel)
|
||||||
if (!runtimeCapabilities) {
|
if (!runtimeCapabilities) {
|
||||||
return undefined
|
return undefined
|
||||||
|
|||||||
Reference in New Issue
Block a user