mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 02:11:23 +00:00
* Default reasoning to on when model has reasoning: true (fix #22456) What: When a model is configured with reasoning: true in openclaw.json (e.g. OpenRouter x-ai/grok-4.1-fast), the session now defaults reasoningLevel to on if the user has not set it via /reasoning or session store. Why: Users expected setting reasoning: true on the model to enable reasoning; previously only session/directive reasoningLevel was used and it always defaulted to off, so Think stayed off despite the model config. * Chore: sync formatted files from main for CI * Changelog: note zwffff/main OpenRouter fix * Changelog: fix OpenRouter entry text * Update msteams.md * Update msteams.md * Update msteams.md --------- Co-authored-by: 曾文锋0668000834 <zeng.wenfeng@xydigit.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
This commit is contained in:
@@ -529,6 +529,21 @@ export function resolveThinkingDefault(params: {
|
||||
return "off";
|
||||
}
|
||||
|
||||
/** Default reasoning level when session/directive do not set it: "on" if model supports reasoning, else "off". */
|
||||
export function resolveReasoningDefault(params: {
|
||||
provider: string;
|
||||
model: string;
|
||||
catalog?: ModelCatalogEntry[];
|
||||
}): "on" | "off" {
|
||||
const key = modelKey(params.provider, params.model);
|
||||
const candidate = params.catalog?.find(
|
||||
(entry) =>
|
||||
(entry.provider === params.provider && entry.id === params.model) ||
|
||||
(entry.provider === key && entry.id === params.model),
|
||||
);
|
||||
return candidate?.reasoning === true ? "on" : "off";
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the model configured for Gmail hook processing.
|
||||
* Returns null if hooks.gmail.model is not set.
|
||||
|
||||
Reference in New Issue
Block a user