fix(ollama): show full thinking levels for discovered reasoning models#93946
fix(ollama): show full thinking levels for discovered reasoning models#93946Alix-007 wants to merge 1 commit into
Conversation
837891f to
b5b4006
Compare
b5b4006 to
6cfebdc
Compare
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. This PR should close as superseded: it changes the Ollama provider-policy fallback, but the reported menu bug is best owned by the native command menu using runtime catalog metadata, which #94067 already targets across Telegram, Slack, and Discord. 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 route the remaining fix through #94067, where native So I’m closing this here and keeping the remaining discussion on #94067. Review detailsBest possible solution: Close this branch and route the remaining fix through #94067, where native Do we have a high-confidence way to reproduce the issue? Yes for source reproduction: the linked user issue gives concrete OpenClaw 2026.6.8 Telegram/Ollama steps, and current source shows native menu choices fall back to configured-only catalog metadata. I did not run a live Telegram/Ollama endpoint in this read-only review. Is this the best way to solve the issue? No. This provider-name heuristic is not the best fix because the missing fact is already available in the runtime model catalog, and the canonical channel-side PR passes that catalog into native Security review: Security review cleared: The diff only changes TypeScript Ollama provider-policy logic and tests, with no dependency, workflow, secret, permission, package, or supply-chain surface changes. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against c4d1f37d3326. |
|
Closing in favor of #94067 (platinum, ready for maintainer review), which supersedes this change for the same area. Keeping the queue focused — thanks! |
Summary
The
/thinkmenu shows onlyofffor live-discovered Ollama reasoning models (e.g.glm-5.2:cloud), while the runtime actually accepts/think medium— the menu-vs-runtime divergence reported in #93835.Root cause: the menu path (
directive-handling→provider-thinking→ ollamaresolveThinkingProfile) receivesreasoning=undefinedfor live-discovered models, so it returnsOLLAMA_NON_REASONING_THINKING_PROFILE(onlyoff). But discovery (provider-models.ts) already computesreasoning=truefrom/api/showcapabilities.includes("thinking")— that flag just never reached the policy surface. (Runtimestream.tsusesmodel?.reasoning !== false, treatingundefinedas thinking-capable, hence the divergence.)Changes
resolveThinkingProfilenow prefers the catalog/discoveredreasoningflag, falling back to a model-name heuristic only when it is absent — socapabilities: thinkinglive models get the fulloff/low/medium/high/maxprofile, matching runtime acceptance.extensions/ollama/src/reasoning-models.tsso the policy surface doesn't pull in discovery/runtime deps fromprovider-models.ts; discovery reuses the same helper (batch logic unchanged).Real behavior proof
Behavior addressed: discovered reasoning models (
reasoning=true) now expose the full thinking-level menu; non-reasoning (reasoning=false) staysoff-only; absent flag falls back to the name heuristic.Test (real exported function):
provider-policy-api.test.tsdrives the realresolveThinkingProfile— added cases forreasoning=true→ returnsoff/low/medium/high/max,reasoning=false→offonly, andreasoningabsent → heuristic fallback.Scope / context
Linked to #93835 (reported with reproduction). Competing PRs #93844/#93864/#93872/#93882 only fall back to the model-name heuristic, but
/r1|reasoning|think|reason/ireturnsfalsefor the reportedglm-5.2:cloud, so they don't fix the reported model. This fix uses the actualcapabilities-derivedreasoningflag from discovery, correctly covering it.