fix(ollama): resolve thinking profile for live-discovered models#93844
fix(ollama): resolve thinking profile for live-discovered models#93844lzyyzznl wants to merge 1 commit into
Conversation
Live-discovered Ollama models report thinking capabilities via /api/show but the thinking profile resolver only used the catalog-provided `reasoning` flag, which is undefined for runtime-discovered models not in the configured catalog. This caused /think to show only "default, off" even for models that support thinking. Fix: fall back to the model name heuristic when reasoning is undefined, matching the logic in buildOllamaModelDefinition.
1c02159 to
b052220
Compare
|
ClawSweeper review: did not complete due to Codex infrastructure failure. Reviewed June 16, 2026, 9:59 PM ET / 01:59 UTC. Summary PR surface: Source +3. Total +3 across 2 files. Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path. Review metrics: none identified. Merge readiness This is a ClawSweeper/Codex infrastructure failure, not a PR readiness or patch-quality verdict. Risk before merge
Maintainer options:
Next step before merge
Review detailsBest possible solution: Retry the Codex review after fixing the execution failure. Do we have a high-confidence way to reproduce the issue? Unclear. The review failed before ClawSweeper could establish a reproduction path. Is this the best way to solve the issue? Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against fbfaba09fd28. Evidence reviewedPR surface: Source +3. Total +3 across 2 files. View PR surface stats
What I checked:
Likely related people:
How this review workflow works
|
|
Migrated to Pandah97/openclaw fork - see replacement PR |
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?