mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 12:11:23 +00:00
fix: align ZAI thinking toggles
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { listThinkingLevels, normalizeReasoningLevel, normalizeThinkLevel } from "./thinking.js";
|
||||
import {
|
||||
listThinkingLevelLabels,
|
||||
listThinkingLevels,
|
||||
normalizeReasoningLevel,
|
||||
normalizeThinkLevel,
|
||||
} from "./thinking.js";
|
||||
|
||||
describe("normalizeThinkLevel", () => {
|
||||
it("accepts mid as medium", () => {
|
||||
@@ -9,6 +14,10 @@ describe("normalizeThinkLevel", () => {
|
||||
it("accepts xhigh", () => {
|
||||
expect(normalizeThinkLevel("xhigh")).toBe("xhigh");
|
||||
});
|
||||
|
||||
it("accepts on as low", () => {
|
||||
expect(normalizeThinkLevel("on")).toBe("low");
|
||||
});
|
||||
});
|
||||
|
||||
describe("listThinkingLevels", () => {
|
||||
@@ -25,6 +34,17 @@ describe("listThinkingLevels", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("listThinkingLevelLabels", () => {
|
||||
it("returns on/off for ZAI", () => {
|
||||
expect(listThinkingLevelLabels("zai", "glm-4.7")).toEqual(["off", "on"]);
|
||||
});
|
||||
|
||||
it("returns full levels for non-ZAI", () => {
|
||||
expect(listThinkingLevelLabels("openai", "gpt-4.1-mini")).toContain("low");
|
||||
expect(listThinkingLevelLabels("openai", "gpt-4.1-mini")).not.toContain("on");
|
||||
});
|
||||
});
|
||||
|
||||
describe("normalizeReasoningLevel", () => {
|
||||
it("accepts on/off", () => {
|
||||
expect(normalizeReasoningLevel("on")).toBe("on");
|
||||
|
||||
Reference in New Issue
Block a user