Skip to content

Commit a04398a

Browse files
RichChen01claude
andcommitted
fix(ollama): show all thinking levels in /think menu for dynamically-discovered models
When an Ollama model with thinking capability is dynamically discovered (e.g. via local Ollama endpoint), it is not in the configured model catalog. The resolveThinkingProfile function was treating undefined reasoning as non-reasoning, returning only ['off'] levels — causing Telegram /think menu to show only 'default, off'. Fix: only return the restricted off-only profile when reasoning is explicitly false. When reasoning is undefined (dynamic model, unknown capabilities), return the full reasoning profile so all thinking levels are available in the menu. Co-Authored-By: Claude <[email protected]>
1 parent 0c651fd commit a04398a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

extensions/ollama/provider-policy-api.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,11 @@ export function resolveThinkingProfile({
5656
}: {
5757
reasoning?: boolean;
5858
}): ProviderThinkingProfile {
59-
return reasoning ? OLLAMA_REASONING_THINKING_PROFILE : OLLAMA_NON_REASONING_THINKING_PROFILE;
59+
// When reasoning is undefined (e.g. dynamically-discovered model not in catalog),
60+
// treat it as reasoning-capable so the /think menu shows all available levels.
61+
// Only restrict to off-only when reasoning is explicitly false.
62+
if (reasoning === false) {
63+
return OLLAMA_NON_REASONING_THINKING_PROFILE;
64+
}
65+
return OLLAMA_REASONING_THINKING_PROFILE;
6066
}

0 commit comments

Comments
 (0)