fix: improve Ollama thinking profile resolution for live-discovered reasoning models using name heuristic#94362
fix: improve Ollama thinking profile resolution for live-discovered reasoning models using name heuristic#94362lizanle521 wants to merge 1 commit into
Conversation
…easoning models using name heuristic
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: the open runtime-catalog PR is the stronger canonical fix for the same live-discovered Ollama Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Keep the remaining work on #94067 and #93835, where runtime catalog metadata remains authoritative for native So I’m closing this here and keeping the remaining discussion on #94067 and #93835. Review detailsBest possible solution: Keep the remaining work on #94067 and #93835, where runtime catalog metadata remains authoritative for native Do we have a high-confidence way to reproduce the issue? Yes. The linked issue gives concrete OpenClaw 2026.6.8 Telegram/Ollama steps, and current main shows native menus can fall back to configured-only catalog metadata while Ollama discovery records Is this the best way to solve the issue? No. This branch is a plausible provider-policy mitigation for heuristic-matching models, but the best fix is to pass the existing runtime catalog into native Security review: Security review cleared: The diff changes provider policy logic and imports an existing local helper; it does not touch dependencies, lockfiles, workflows, secrets, package resolution, or other supply-chain surfaces. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against f18ff7551edc. |
|
Superseded by #94067, landed in e3ccf87. The canonical fix uses the discovered model's declared reasoning capability through the runtime catalog across Telegram, Slack, and Discord. This avoids a GLM/model-name heuristic and keeps the behavior correct for any live-discovered reasoning model. Thanks @lizanle521 for the investigation and patch. |
Problem
Telegram
/thinkmenu shows onlyofffor live-discovered Ollama thinking models (no catalog entry), but/think <level>accepts them.Root Cause
For models discovered at runtime (not in static config/catalog),
reasoningflag passed toresolveThinkingProfileisundefined. The Ollama plugin previously returned an off-only profile whenreasoningwas not explicitly true.Solution
Modified
resolveThinkingProfileinextensions/ollama/provider-policy-api.tsto also consider model name heuristics whenreasoningis not explicitly false. We now treat a model as reasoning if either:reasoning === true(catalog explicitly says it's a reasoning model)isReasoningModelHeuristic(modelId)returns true (based on common reasoning model naming patterns)This ensures that live-discovered Ollama models with reasoning capabilities (e.g. deepseek-r1, qwen3:...thinker) get the full thinking level menu, while still respecting explicit non-reasoning flags.
Fixes #93835
Real behavior proof
Setup
deepseek-r1:latestorqwen3:14b).Steps
config.yamlmodel catalog)./thinkto view the menu.Expected after fix
/thinkmenu displays multiple reasoning levels (e.g.,off,low,medium,highor similar) for the live-discovered reasoning model.offwas shown; now the full list appears.Optional verification
isReasoningModelHeuristicwith known reasoning model name patterns.listThinkingLevels(provider='ollama', model='deepseek-r1', catalog={})and confirm it returns a non-off-only profile.(If you have runtime logs or screenshots, attach them here.)