Skip to content

fix(ollama): show full thinking levels for live-discovered models in /think menu#93872

Closed
lzyyzznl wants to merge 1 commit into
openclaw:mainfrom
lzyyzznl:fix/issue-93835-telegram-think-menu
Closed

fix(ollama): show full thinking levels for live-discovered models in /think menu#93872
lzyyzznl wants to merge 1 commit into
openclaw:mainfrom
lzyyzznl:fix/issue-93835-telegram-think-menu

Conversation

@lzyyzznl

Copy link
Copy Markdown
Contributor

Summary

Changes

extensions/ollama/provider-policy-api.ts — 1 file, +8/-1

Decision table

reasoning value Before After
true (explicitly configured) ["off","low","medium","high","max"] unchanged
false (explicitly disabled) ["off"] unchanged
undefined (live-discovered) ["off"] ["off","low","medium","high","max"]

Risk checklist

Did user-visible behavior change? (Yes) — /think menu now shows full thinking levels for undiscovered Ollama models
Did config, environment, or migration behavior change? (No)
Did security, auth, secrets, network, or tool execution behavior change? (No)
What is the highest-risk area? — Models that truly do NOT support thinking will now show thinking levels they can't use
How is that risk mitigated? — Setting explicit reasoning:false in the model config still yields the off-only profile. Ollama models generally support thinking.

…/think menu

When an Ollama model is live-discovered (not in configured catalog),
the provider's resolveThinkingProfile received reasoning:undefined
and returned the non-reasoning profile with only ['off']. This made
the /think inline keyboard show no useful options.

Change the ternary to an explicit false check: reasoning===false
still yields the off-only profile, but undefined (live-discovered)
now defaults to the reasoning profile so /think shows realistic
choices for newly discovered models.

Fixes openclaw#93835
@openclaw-barnacle openclaw-barnacle Bot added extensions: ollama size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 17, 2026
@clawsweeper

clawsweeper Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 17, 2026, 2:05 AM ET / 06:05 UTC.

Summary
Changes Ollama provider thinking-profile resolution so reasoning: undefined returns the full off/low/medium/high/max profile instead of off-only.

PR surface: Source +7. Total +7 across 1 file.

Reproducibility: yes. Source inspection shows the reported path: Telegram menu resolution uses configured catalog metadata, while Ollama discovery can derive reasoning:true from capabilities that are not passed into that menu resolver.

Review metrics: 1 noteworthy metric.

  • Ollama reasoning fallback: 1 fallback path changed. The diff changes how missing provider reasoning metadata is interpreted, which affects existing configured and live-discovered Ollama model controls before merge.

Root-cause cluster
Relationship: same_root_cause
Canonical: #93835
Summary: This PR and sibling candidate PRs all target the same Ollama/Telegram /think menu mismatch from the linked bug, but no canonical implementation PR is proven yet.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🦪 silver shellfish
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted after-fix proof from a real Telegram /think menu against a live-discovered Ollama thinking model.
  • [P1] Narrow the implementation so capability-confirmed runtime catalog metadata drives the menu without making all missing Ollama reasoning metadata supported.
  • [P1] Add a focused regression test for the menu/resolver path that distinguishes reasoning:true, reasoning:false, and missing metadata.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body provides rationale and a decision table but no after-fix Telegram/Ollama runtime output, screenshot, recording, or logs; contributor action is needed before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Mantis proof suggestion
A Telegram Desktop proof would directly show whether /think presents full levels for the reported live-discovered Ollama model after the fix. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram desktop proof: verify that /think shows full levels for a live-discovered Ollama thinking model and keeps non-thinking models off-only.

Risk before merge

  • [P1] Merging this PR can expose low, medium, high, and max for existing Ollama models whose catalog row simply omits reasoning, even when no runtime capability metadata proves thinking support.
  • [P1] The external PR still lacks after-fix real behavior proof from Telegram plus Ollama; CI also reports the real-behavior-proof gate as failing.
  • [P1] Several open candidate PRs target the same linked bug, so maintainers should pick one canonical repair path before merging competing branches.

Maintainer options:

  1. Keep the fallback narrow (recommended)
    Update the PR to pass runtime catalog/capability metadata into the menu resolver, or otherwise distinguish capability-confirmed live models from generic missing metadata before showing full thinking levels.
  2. Accept the broader Ollama policy
    Maintainers can intentionally decide that all unknown Ollama models should advertise full thinking controls, but that should be an explicit compatibility decision with proof for non-thinking models.
  3. Choose a competing canonical PR
    If another open candidate provides the narrower catalog-based fix with real proof, close this PR as superseded after that path is selected or merged.

Next step before merge

  • [P1] Needs human review because the code blocker is a compatibility-sensitive fix-shape decision and the external PR is missing contributor real behavior proof.

Security
Cleared: The diff only changes an Ollama provider policy branch and does not touch dependencies, secrets, auth, CI, package resolution, or code-execution surfaces.

Review findings

  • [P1] Do not treat missing Ollama reasoning metadata as support — extensions/ollama/provider-policy-api.ts:66
Review details

Best possible solution:

Use the selected model's runtime catalog or capability-derived reasoning metadata for the /think menu while keeping explicit reasoning:false and unproven metadata authoritative.

Do we have a high-confidence way to reproduce the issue?

Yes. Source inspection shows the reported path: Telegram menu resolution uses configured catalog metadata, while Ollama discovery can derive reasoning:true from capabilities that are not passed into that menu resolver.

Is this the best way to solve the issue?

No. The patch is a plausible workaround, but the best fix is narrower: use the runtime catalog/capability-derived reasoning for the selected model instead of treating every missing Ollama reasoning hint as support.

Full review comments:

  • [P1] Do not treat missing Ollama reasoning metadata as support — extensions/ollama/provider-policy-api.ts:66
    This fallback is used whenever the thinking menu cannot find a catalog row for the selected Ollama model. With this change, any configured or unknown Ollama model with reasoning omitted is advertised as supporting low, medium, high, and max, even when discovery/config did not prove capabilities.includes("thinking") or explicit reasoning:true. That can persist unsupported /think levels and make the menu diverge for non-thinking Ollama models; fix the menu by passing runtime catalog or capability-derived reasoning for the selected model instead of changing the provider-wide undefined policy.
    Confidence: 0.84

Overall correctness: patch is incorrect
Overall confidence: 0.86

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 580bba0637e0.

Label changes

Label changes:

  • add P2: This is a normal-priority user-visible Ollama/Telegram command-menu bugfix with limited blast radius but a real compatibility concern.
  • add merge-risk: 🚨 compatibility: The PR changes fallback behavior for Ollama models with missing reasoning metadata, which can alter existing /think options during upgrades or for configured models.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body provides rationale and a decision table but no after-fix Telegram/Ollama runtime output, screenshot, recording, or logs; contributor action is needed before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • add mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The intended behavior is visible in the Telegram /think menu and is well suited to a short native Telegram proof recording.

Label justifications:

  • P2: This is a normal-priority user-visible Ollama/Telegram command-menu bugfix with limited blast radius but a real compatibility concern.
  • merge-risk: 🚨 compatibility: The PR changes fallback behavior for Ollama models with missing reasoning metadata, which can alter existing /think options during upgrades or for configured models.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body provides rationale and a decision table but no after-fix Telegram/Ollama runtime output, screenshot, recording, or logs; contributor action is needed before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The intended behavior is visible in the Telegram /think menu and is well suited to a short native Telegram proof recording.
Evidence reviewed

PR surface:

Source +7. Total +7 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 8 1 +7
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 8 1 +7

What I checked:

Likely related people:

  • vincentkoc: Current blame for the Ollama provider policy, Telegram native menu path, and thinking helpers points to the June 17 command refactor commit that carried the present behavior on main. (role: recent area contributor; confidence: medium; commits: 71ce525c6922; files: extensions/ollama/provider-policy-api.ts, extensions/telegram/src/bot-native-commands.ts, src/auto-reply/commands-registry.ts)
  • steipete: Recent history shows the provider-thinking fallback refactor in the same decision surface, making this a useful routing candidate for the thinking-policy boundary. (role: adjacent owner; confidence: medium; commits: fca80d2ee23d; files: src/auto-reply/thinking.ts, src/plugins/provider-thinking.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jun 17, 2026
@lzyyzznl

Copy link
Copy Markdown
Contributor Author

Closing due to behavior proof failures — the proof environment seems unable to demonstrate the fix end-to-end. The core logic change is preserved in the branch for future reference.

@lzyyzznl lzyyzznl closed this Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: ollama mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Telegram /think menu shows only off for live-discovered Ollama thinking models, but /think <level> accepts them

2 participants