feat(settings): expose custom reasoning effort

This commit is contained in:
XZH
2026-08-26 17:16:34 -07:00
parent 8e281c6e27
commit 7028f7e511
2 changed files with 42 additions and 4 deletions

View File

@@ -129,7 +129,14 @@ export function reasoningEffortOptions(
: options([], current);
}
if (BINARY_THINKING_PROVIDERS.has(provider) || provider === "custom") {
if (provider === "custom") {
// A user-supplied OpenAI-compatible endpoint may route to any upstream
// model, so expose the common cross-gateway levels and let Auto handle
// providers without an explicit control.
return options(["none", "low", "medium", "high"], current);
}
if (BINARY_THINKING_PROVIDERS.has(provider)) {
const supported =
provider === "minimax" ||
includesAny(modelName, [
@@ -152,7 +159,7 @@ export function reasoningEffortOptions(
}
}
if (OPENAI_PROVIDERS.has(provider) || provider === "custom") {
if (OPENAI_PROVIDERS.has(provider)) {
const isGpt5OrCodex = includesAny(modelName, ["gpt-5", "codex"]);
if (isGpt5OrCodex) {
return options(["minimal", "low", "medium", "high", "xhigh"], current);

View File

@@ -92,11 +92,42 @@ test("known reasoning families get conservative provider-specific choices", () =
"high",
]);
assert.deepEqual(values("dashscope", "qwen3-max"), ["", "minimal", "high"]);
assert.deepEqual(values("custom", "deepseek-reasoner"), [
});
test("OpenAI-compatible gateways expose explicit effort levels", () => {
assert.deepEqual(values("custom", "idrouter/qd/lite"), [
"",
"minimal",
"none",
"low",
"medium",
"high",
]);
assert.deepEqual(values("openai-compatible", "gateway/model"), [
"",
"none",
"low",
"medium",
"high",
]);
assert.deepEqual(values("custom", "gateway/model", "vendor-level"), [
"",
"none",
"low",
"medium",
"high",
"vendor-level",
]);
});
test("Anthropic-compatible aliases follow the Anthropic model rules", () => {
assert.deepEqual(
values("anthropic-compatible", "claude-sonnet-4-5"),
["", "none", "low", "medium", "high"],
);
assert.deepEqual(
values("anthropic_compatible", "claude-opus-4-6").includes("adaptive"),
false,
);
});
test("unknown models stay hidden unless they already carry an override", () => {