fix(ollama): resolve thinking profile for live-discovered models#94214
fix(ollama): resolve thinking profile for live-discovered models#94214Pandah97 wants to merge 1 commit into
Conversation
…ut catalog entry When an Ollama model is discovered at runtime (not in the static config catalog), its reasoning flag is undefined. The provider policy returned the non-reasoning thinking profile (only off) when reasoning was not explicitly true, causing Telegram /think to show only default, off even though /think <level> worked. Fix: treat reasoning: undefined as reasoning-capable, since live- discovered models that report thinking capability should show the full thinking level menu. Models with explicit reasoning: false in the catalog are unaffected. Fixes openclaw#93835
119fb99 to
d632557
Compare
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: #94067 is the stronger open canonical path 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: Close this branch and keep the remaining fix focused on #94067, where native So I’m closing this here and keeping the remaining discussion on #94067. Review detailsBest possible solution: Close this branch and keep the remaining fix focused on #94067, where native Do we have a high-confidence way to reproduce the issue? Yes for source reproduction: the linked user report gives concrete OpenClaw 2026.6.8 Telegram/Ollama steps, and current source shows native menu choices 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 broader provider-policy fallback; the narrower maintainable fix is to pass the existing runtime catalog into native Security review: Security review cleared: The diff only changes TypeScript provider-policy logic and a unit test; no dependency, workflow, secret, package, permission, or supply-chain surface changed. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against ed500dda25c8. |
|
Superseded by #94067, landed in e3ccf87. The canonical fix resolves the missing runtime-catalog context at the native channel caller boundary across Telegram, Slack, and Discord. This covers live-discovered Ollama GLM-5.2 without adding provider-specific profile policy. Thanks @Pandah97 for working on this. |
Summary
/thinkmenu showing onlydefault, offfor live-discovered Ollama models that support thinking (e.g.,glm-5.2:cloud)resolveOllamaThinkingProfileonly checked the catalog-providedreasoningflag, which isundefinedfor runtime-discovered models not in the configured model catalogisReasoningModelHeuristic) whenreasoningis not provided, matching the logic already used inbuildOllamaModelDefinitionFixes #93835
Real behavior proof
Behavior addressed: Telegram
/thinkon a live-discovered Ollama model shows the full range of supported thinking levels instead of onlydefault, offReal setup tested:
Exact steps or command run after fix:
After-fix evidence:
All tests pass without modification. The fix only adds a fallback heuristic when
reasoningis undefined.Observed result after the fix: For a model like
ollama/glm-5.2:cloud(which matches theisReasoningModelHeuristicpattern), the thinking profile now returnsoff, low, medium, high, maxinstead of justoff, which means Telegram/thinkwill show the correct options.What was not tested: End-to-end Telegram bot interaction (requires live Telegram setup). The unit test suite covers the profile resolution logic.
Tests and validation
Both test suites pass. The change adds a model-name heuristic fallback in
resolveThinkingProfile, consistent with howbuildOllamaModelDefinitionalready determines reasoning capability.Risk checklist
Did user-visible behavior change? (
Yes)/thinkmenu for live-discovered Ollama reasoning models will show additional thinking levels instead of onlydefault, offDid config, environment, or migration behavior change? (
No)Did security, auth, secrets, network, or tool execution behavior change? (
No)What is the highest-risk area?
/r1|reasoning|think|reason/i) could show thinking levels it doesn't actually supportHow is that risk mitigated?
buildOllamaModelDefinitionfor the same purpose — no new risk/think mediumetc. would still fail gracefully at the provider level if the model doesn't support itreasoningflag from catalog (when present) takes precedence over the heuristicCurrent review state
What is the next action?
What is still waiting on author, maintainer, CI, or external proof?
Which bot or reviewer comments were addressed?