Thinking: accept extra-high alias and sync Codex FAQ wording
This commit is contained in:
@@ -15,6 +15,11 @@ describe("normalizeThinkLevel", () => {
|
||||
expect(normalizeThinkLevel("xhigh")).toBe("xhigh");
|
||||
});
|
||||
|
||||
it("accepts extra-high aliases as xhigh", () => {
|
||||
expect(normalizeThinkLevel("extra-high")).toBe("xhigh");
|
||||
expect(normalizeThinkLevel("extra high")).toBe("xhigh");
|
||||
});
|
||||
|
||||
it("accepts on as low", () => {
|
||||
expect(normalizeThinkLevel("on")).toBe("low");
|
||||
});
|
||||
|
||||
@@ -40,7 +40,11 @@ export function normalizeThinkLevel(raw?: string | null): ThinkLevel | undefined
|
||||
if (!raw) {
|
||||
return undefined;
|
||||
}
|
||||
const key = raw.toLowerCase();
|
||||
const key = raw.trim().toLowerCase();
|
||||
const collapsed = key.replace(/[\s_-]+/g, "");
|
||||
if (collapsed === "xhigh" || collapsed === "extrahigh") {
|
||||
return "xhigh";
|
||||
}
|
||||
if (["off"].includes(key)) {
|
||||
return "off";
|
||||
}
|
||||
@@ -61,9 +65,6 @@ export function normalizeThinkLevel(raw?: string | null): ThinkLevel | undefined
|
||||
) {
|
||||
return "high";
|
||||
}
|
||||
if (["xhigh", "x-high", "x_high"].includes(key)) {
|
||||
return "xhigh";
|
||||
}
|
||||
if (["think"].includes(key)) {
|
||||
return "minimal";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user