openclaw - ✅(Solved) Fix Ollama provider: /think menu only shows 'off' for reasoning-capable models [1 pull requests, 6 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#73515Fetched 2026-04-29 06:18:58
View on GitHub
Comments
6
Participants
4
Timeline
13
Reactions
0
Timeline (top)
commented ×6subscribed ×3mentioned ×2closed ×1

Root Cause

The /think command handler calls listThinkingLevels(provider, model) which internally calls resolveThinkingProfile({ provider, model }) without passing the model catalog.

The Ollama provider's resolveThinkingProfile resolves levels based on the reasoning flag from the catalog:

resolveThinkingProfile: ({ reasoning }) => ({
  levels: reasoning === true ? [
    { id: "off" }, { id: "low" }, { id: "medium" }, { id: "high" }, { id: "max" }
  ] : [{ id: "off" }],
  defaultLevel: "off"
})

Since the catalog is not passed, reasoning is undefined, and undefined !== true, so only off is returned.

Fix Action

Workaround

Setting agents.defaults.thinkingDefault: "medium" works for the actual thinking level (the API receives think: "medium"), but the /think menu still only shows off.

PR fix notes

PR #73568: fix(telegram): show Ollama think levels from catalog [AI]

Description (problem / solution / changelog)

Summary

Fixes the native /think argument menu for configured Ollama models whose catalog entry has reasoning: true.

Root Cause

The /think command resolved dynamic menu choices with only provider/model context. Ollama's thinking profile depends on catalog reasoning metadata, so configured reasoning-capable Ollama models fell back to the provider's non-reasoning profile and exposed only off.

Linked Issue

Fixes #73515.

Why This Is Safe

The change reuses the existing configured model catalog builder and the existing catalog-aware listThinkingLevels path. Static choices and commands without dynamic choices are unchanged, and callers can still pass an explicit catalog when they have one.

Security And Runtime Controls

No authorization, command gating, provider execution, prompt construction, or runtime policy controls change. This only changes which pre-existing /think levels are displayed in the native argument menu.

Tests

  • git diff --check
  • pnpm test src/auto-reply/commands-registry.test.ts
  • pnpm changed:lanes --json
  • pnpm check:changed

Out Of Scope

  • Querying Ollama /api/show from the command menu path.
  • Changing how thinking levels are applied after a user selects a level.
  • Broader native command menu redesigns for channel-specific UX.

Contributor Notes

  • AI-assisted change.

Made with Cursor

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • src/auto-reply/commands-registry.shared.ts (modified, +1/-1)
  • src/auto-reply/commands-registry.test.ts (modified, +58/-0)
  • src/auto-reply/commands-registry.ts (modified, +27/-4)
  • src/auto-reply/commands-registry.types.ts (modified, +2/-0)

Code Example

resolveThinkingProfile: ({ reasoning }) => ({
  levels: reasoning === true ? [
    { id: "off" }, { id: "low" }, { id: "medium" }, { id: "high" }, { id: "max" }
  ] : [{ id: "off" }],
  defaultLevel: "off"
})
RAW_BUFFERClick to expand / collapse

Bug

The /think native command menu in Telegram only shows off for Ollama models that have reasoning: true in their model config.

Root Cause

The /think command handler calls listThinkingLevels(provider, model) which internally calls resolveThinkingProfile({ provider, model }) without passing the model catalog.

The Ollama provider's resolveThinkingProfile resolves levels based on the reasoning flag from the catalog:

resolveThinkingProfile: ({ reasoning }) => ({
  levels: reasoning === true ? [
    { id: "off" }, { id: "low" }, { id: "medium" }, { id: "high" }, { id: "max" }
  ] : [{ id: "off" }],
  defaultLevel: "off"
})

Since the catalog is not passed, reasoning is undefined, and undefined !== true, so only off is returned.

Expected Behavior

Models with reasoning: true in their Ollama config should show off, low, medium, high, max in the /think menu.

Environment

  • OpenClaw 2026.4.26
  • Model: ollama/glm-5.1:cloud (has reasoning: true in config, and Ollama reports capabilities: ["thinking", "completion", "tools"])
  • Channel: Telegram

Workaround

Setting agents.defaults.thinkingDefault: "medium" works for the actual thinking level (the API receives think: "medium"), but the /think menu still only shows off.

Suggested Fix

Either:

  1. Pass the runtime model catalog to listThinkingLevels/resolveThinkingProfile in the command handler
  2. Or have the Ollama provider's resolveThinkingProfile fall back to checking the model config's reasoning flag when the catalog is unavailable
  3. Or have the provider query Ollama's /api/show for the thinking capability as a fallback

extent analysis

TL;DR

Pass the runtime model catalog to listThinkingLevels/resolveThinkingProfile in the command handler to fix the /think menu issue for Ollama models with reasoning: true.

Guidance

  • Verify that the reasoning flag is correctly set to true in the model config for the affected Ollama models.
  • Check the implementation of listThinkingLevels and resolveThinkingProfile to ensure they can handle the model catalog being passed correctly.
  • Consider implementing a fallback mechanism, such as checking the model config's reasoning flag or querying Ollama's /api/show for the thinking capability, in case the catalog is unavailable.
  • Test the fix by checking the /think menu for models with reasoning: true to ensure it displays the expected levels (off, low, medium, high, max).

Example

// Example of passing the model catalog to resolveThinkingProfile
const thinkingProfile = resolveThinkingProfile({ provider, model, catalog: modelCatalog });

Notes

The suggested fix assumes that the model catalog is available and can be passed to listThinkingLevels/resolveThinkingProfile. If the catalog is not available, a fallback mechanism may be necessary.

Recommendation

Apply workaround by passing the runtime model catalog to listThinkingLevels/resolveThinkingProfile in the command handler, as this is the most straightforward fix and does not require modifying the Ollama provider's implementation.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING