feat(providers): add max thinking level for gpt-5.6-sol (#2500)
Expose max in the Codex thinking dropdown for gpt-5.6-sol only (maps to xhigh on wire; live probe rejected ultra). Include custom/kilo models when computing provider thinking options so manually added gpt-5.6-sol contributes its max level. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
ddd5509e97
commit
b9e2611045
3 changed files with 37 additions and 4 deletions
|
|
@ -32,6 +32,8 @@ const FORMAT_LEVELS = {
|
||||||
|
|
||||||
// Model-name pattern overrides (glob, first match wins) — more precise than format default.
|
// Model-name pattern overrides (glob, first match wins) — more precise than format default.
|
||||||
const PATTERN_THINKING = [
|
const PATTERN_THINKING = [
|
||||||
|
// gpt-5.6-sol accepts max (maps to xhigh on wire); live probe rejected ultra.
|
||||||
|
{ pattern: "*gpt-5.6-sol*", levels: ["none", "minimal", "low", "medium", "high", "xhigh", "max"] },
|
||||||
{ pattern: "*codex*", levels: ["low", "medium", "high", "xhigh"] }, // codex cannot disable thinking
|
{ pattern: "*codex*", levels: ["low", "medium", "high", "xhigh"] }, // codex cannot disable thinking
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -156,17 +156,27 @@ export default function ProviderDetailPage() {
|
||||||
const levels = getThinkingLevels(providerId, modelId);
|
const levels = getThinkingLevels(providerId, modelId);
|
||||||
return levels && levels.includes(thinkingMode) ? thinkingMode : null;
|
return levels && levels.includes(thinkingMode) ? thinkingMode : null;
|
||||||
};
|
};
|
||||||
|
const providerStorageAlias = isCompatible ? providerId : providerAlias;
|
||||||
// Union of levels across this provider's reasoning models — drives the level picker options.
|
// Union of levels across this provider's reasoning models — drives the level picker options.
|
||||||
|
// Include custom models too (e.g. manually added gpt-5.6-sol → max).
|
||||||
const providerThinkingLevels = (() => {
|
const providerThinkingLevels = (() => {
|
||||||
const set = new Set();
|
const set = new Set();
|
||||||
for (const m of models) {
|
const seen = new Set();
|
||||||
const lv = getThinkingLevels(providerId, m.id);
|
const addLevels = (modelId) => {
|
||||||
|
if (!modelId || seen.has(modelId)) return;
|
||||||
|
seen.add(modelId);
|
||||||
|
const lv = getThinkingLevels(providerId, modelId);
|
||||||
if (lv) lv.forEach((l) => { if (l !== "none") set.add(l); });
|
if (lv) lv.forEach((l) => { if (l !== "none") set.add(l); });
|
||||||
|
};
|
||||||
|
for (const m of models) addLevels(m.id);
|
||||||
|
for (const m of kiloFreeModels) addLevels(m.id);
|
||||||
|
for (const entry of customModels) {
|
||||||
|
if (entry.providerAlias !== providerStorageAlias) continue;
|
||||||
|
if ((entry.kind || entry.type || "llm") !== "llm") continue;
|
||||||
|
addLevels(entry.id);
|
||||||
}
|
}
|
||||||
return set.size ? ["auto", ...[...set]] : null;
|
return set.size ? ["auto", ...[...set]] : null;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
const providerStorageAlias = isCompatible ? providerId : providerAlias;
|
|
||||||
const providerDisplayAlias = isCompatible
|
const providerDisplayAlias = isCompatible
|
||||||
? (providerNode?.prefix || providerId)
|
? (providerNode?.prefix || providerId)
|
||||||
: providerAlias;
|
: providerAlias;
|
||||||
|
|
|
||||||
21
tests/unit/thinking-levels-gpt56-sol.test.js
Normal file
21
tests/unit/thinking-levels-gpt56-sol.test.js
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
import { describe, it, expect } from "vitest";
|
||||||
|
import { getThinkingLevels } from "../../open-sse/providers/thinkingLevels.js";
|
||||||
|
|
||||||
|
describe("getThinkingLevels", () => {
|
||||||
|
it("adds max for gpt-5.6-sol on codex", () => {
|
||||||
|
const levels = getThinkingLevels("codex", "gpt-5.6-sol");
|
||||||
|
expect(levels).toContain("max");
|
||||||
|
expect(levels).toContain("xhigh");
|
||||||
|
expect(levels).not.toContain("ultra");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("does not add max for other codex models", () => {
|
||||||
|
const levels = getThinkingLevels("codex", "gpt-5.3-codex");
|
||||||
|
expect(levels).toEqual(["low", "medium", "high", "xhigh"]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("does not add max for other gpt-5.6 models", () => {
|
||||||
|
const levels = getThinkingLevels("codex", "gpt-5.5");
|
||||||
|
expect(levels || []).not.toContain("max");
|
||||||
|
});
|
||||||
|
});
|
||||||
Loading…
Reference in a new issue