fix(agents): prioritize per-model thinking defaults (#30439)

* fix(agents): honor per-model thinking defaults

* fix(agents): preserve thinking fallback with model defaults

---------

Co-authored-by: Mark L <73659136+markliuyuxiang@users.noreply.github.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
Mark L
2026-03-02 12:00:02 +08:00
committed by GitHub
parent 3fc19ed7d7
commit 0f2dce0483
9 changed files with 123 additions and 31 deletions

View File

@@ -525,6 +525,19 @@ export function resolveThinkingDefault(params: {
model: string;
catalog?: ModelCatalogEntry[];
}): ThinkLevel {
const perModelThinking =
params.cfg.agents?.defaults?.models?.[modelKey(params.provider, params.model)]?.params
?.thinking;
if (
perModelThinking === "off" ||
perModelThinking === "minimal" ||
perModelThinking === "low" ||
perModelThinking === "medium" ||
perModelThinking === "high" ||
perModelThinking === "xhigh"
) {
return perModelThinking;
}
const configured = params.cfg.agents?.defaults?.thinkingDefault;
if (configured) {
return configured;