Skip to content

Commit bc5d369

Browse files
committed
test(shared): cover a user-selected effort outside the K3 ladder
Review feedback: a mutation dropping the .includes() ladder check in shouldUseReasoningEffort would survive the existing suite (which only covered the default-effort -> true and enableReasoningEffort: false -> false directions). Assert that a user-selected effort ("medium") not present in the K3 capability ladder (["low", "high", "max"]) returns false, both with and with an explicit enableReasoningEffort: true.
1 parent a4eb3c0 commit bc5d369

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎src/shared/__tests__/api.spec.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,4 +732,23 @@ describe("shouldUseReasoningEffort", () => {
732732
shouldUseReasoningEffort({ model, settings: { enableReasoningEffort: false, reasoningEffort: "high" } }),
733733
).toBe(false)
734734
})
735+
736+
test("array capability with a user-selected effort outside the ladder -> false", () => {
737+
const model: ModelInfo = {
738+
contextWindow: 1_000_000,
739+
supportsPromptCache: true,
740+
supportsReasoningEffort: ["low", "high", "max"],
741+
reasoningEffort: "high",
742+
}
743+
744+
// The selection wins over the model default, but "medium" is not in the K3
745+
// ladder, so reasoning must be omitted rather than sent as an unsupported effort.
746+
expect(shouldUseReasoningEffort({ model, settings: { reasoningEffort: "medium" } })).toBe(false)
747+
expect(
748+
shouldUseReasoningEffort({
749+
model,
750+
settings: { enableReasoningEffort: true, reasoningEffort: "medium" },
751+
}),
752+
).toBe(false)
753+
})
735754
})

0 commit comments

Comments
 (0)