File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22import type { ProviderThinkingProfile } from "openclaw/plugin-sdk/plugin-entry" ;
33import type { ModelProviderConfig } from "openclaw/plugin-sdk/provider-model-types" ;
44import { OLLAMA_DEFAULT_BASE_URL } from "./src/defaults.js" ;
5+ import { isReasoningModelHeuristic } from "./src/provider-models.js" ;
56
67type OllamaProviderConfigDraft = Partial < ModelProviderConfig > ;
78
@@ -51,10 +52,17 @@ export function normalizeConfig({
5152 return next ;
5253}
5354
54- export function resolveThinkingProfile ( {
55- reasoning ,
56- } : {
55+ export function resolveThinkingProfile ( ctx : {
56+ provider : string ;
57+ modelId : string ;
5758 reasoning ?: boolean ;
5859} ) : ProviderThinkingProfile {
59- return reasoning ? OLLAMA_REASONING_THINKING_PROFILE : OLLAMA_NON_REASONING_THINKING_PROFILE ;
60+ const { reasoning, modelId } = ctx ;
61+ // If catalog explicitly indicates not a reasoning model, respect that.
62+ if ( reasoning === false ) {
63+ return OLLAMA_NON_REASONING_THINKING_PROFILE ;
64+ }
65+ // Treat as reasoning model if explicitly flagged or name matches known reasoning patterns.
66+ const effectiveReasoning = reasoning === true || isReasoningModelHeuristic ( modelId ) ;
67+ return effectiveReasoning ? OLLAMA_REASONING_THINKING_PROFILE : OLLAMA_NON_REASONING_THINKING_PROFILE ;
6068}
You can’t perform that action at this time.
0 commit comments