fix: default low thinking for reasoning models

This commit is contained in:
Peter Steinberger
2026-01-03 12:18:50 +00:00
parent 6e16c0699a
commit b6301c719b
14 changed files with 308 additions and 20 deletions

View File

@@ -6,6 +6,8 @@ export type ModelRef = {
model: string;
};
export type ThinkLevel = "off" | "minimal" | "low" | "medium" | "high";
export type ModelAliasIndex = {
byAlias: Map<string, { alias: string; ref: ModelRef }>;
byKey: Map<string, string[]>;
@@ -152,3 +154,19 @@ export function buildAllowedModelSet(params: {
return { allowAny: false, allowedCatalog, allowedKeys };
}
export function resolveThinkingDefault(params: {
cfg: ClawdisConfig;
provider: string;
model: string;
catalog?: ModelCatalogEntry[];
}): ThinkLevel {
const configured = params.cfg.agent?.thinkingDefault;
if (configured) return configured;
const candidate = params.catalog?.find(
(entry) =>
entry.provider === params.provider && entry.id === params.model,
);
if (candidate?.reasoning) return "low";
return "off";
}