Skip to content

fix(telegram): show full think levels for live-discovered Ollama models#93882

Closed
xydttsw wants to merge 1 commit into
openclaw:mainfrom
xydttsw:fix/think-menu-ollama
Closed

fix(telegram): show full think levels for live-discovered Ollama models#93882
xydttsw wants to merge 1 commit into
openclaw:mainfrom
xydttsw:fix/think-menu-ollama

Conversation

@xydttsw

@xydttsw xydttsw commented Jun 17, 2026

Copy link
Copy Markdown

AI-assisted PR. Implemented and verified with Claude (Claude Code).

Summary

  • What: Telegram /think inline menu was showing only default, off for live-discovered Ollama thinking models (e.g., ollama/glm-5.2:cloud), even though /think <level> commands like /think medium were accepted and functional.
  • Root cause: The menu resolution path used buildConfiguredModelCatalog() which reads only statically-configured models. Models discovered at runtime (via the {"ollama/*":{}} pattern or automatic Ollama endpoint discovery) were missing from this catalog, so their reasoning capability was unavailable to the thinking profile resolver.
  • Fix: Load the full runtime model catalog via loadModelCatalog() when building the command arg menu, ensuring all discovered models and their capabilities are available to the thinking level choice resolver.

Fixes #93835

Real behavior proof (required for external PRs)

Behavior addressed:
Telegram /think menu now shows the correct thinking levels for live-discovered Ollama models instead of only default, off.

Real environment tested:
OpenClaw dev build with Ollama extension on macOS 26.5.1 with ollama/glm-5.2:cloud model discovered via Ollama endpoint.

Exact steps or command run after this patch:

# 1. Configure Ollama provider with runtime discovery
openclaw config set providers '{"ollama":{"baseUrl":"http://localhost:11434"}}'
# 2. Switch to an Ollama model that supports thinking/openclaw reason
/model ollama/glm-5.2:cloud
# 3. Open the /think inline menu in Telegram
/think

Before-fix evidence:

/model ollama/glm-5.2:cloud
/think
> Current thinking level: high
> Options: default, off
/think medium
> Thinking level set to medium.

The /think menu shows only default, off even though /think medium is accepted — the menu doesn't reflect the actual available levels.

After-fix evidence:

/model ollama/glm-5.2:cloud
/think
> Current thinking level: high
> Options: default, off, low, medium, high, max

The /think menu now shows all thinking levels supported by the Ollama model, consistent with what /think commands actually accept.

Observed result after the fix:
After loading the runtime model catalog, resolveCommandArgMenu has access to the full model reasoning capability metadata, enabling it to present all supported thinking levels for live-discovered models.

What was not tested:

  • Non-Telegram channels (TUI, Discord) have separate menu resolution paths.
  • Edge cases with models that lack reasoning capability entirely (should still show default, off correctly).

Tests and validation

✓ extension build succeeds (TypeScript compilation)
✓ Existing bot-native-commands tests pass

Risk / scope

  • User visible behavior change: Yes (positive — menu now matches reality)
  • Configuration/environment changes: No
  • Security/credentials/network changes: No
  • Highest risk point: None — the change is passing a richer catalog to an existing function parameter
  • Mitigation: The loadModelCatalog() function is already used elsewhere in the same module for resolveTelegramDefaultThinkingLevel

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram 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

ClawSweeper review: did not complete due to Codex infrastructure failure. Reviewed June 16, 2026, 11:57 PM ET / 03:57 UTC.

Summary
Review failed before ClawSweeper could summarize the requested change.

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

Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path.

Review metrics: none identified.

Merge readiness
Not assessed.
Failure reason: invalid structured output.

This is a ClawSweeper/Codex infrastructure failure, not a PR readiness or patch-quality verdict.
Keep any merge decision on the normal maintainer review path until ClawSweeper can complete a fresh review.

Risk before merge

  • [P1] No close action taken because the review did not complete.

Maintainer options:

  1. Decide the mitigation before merge
    Retry the Codex review after fixing the execution failure.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • Review did not complete, so no work-lane recommendation was made.
Review details

Best 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 0c909ea97f20.

Label changes

Label changes:

  • remove proof: sufficient: Current real behavior proof status is not_applicable, not sufficient.
  • remove mantis: telegram-visible-proof: Current Telegram visible-proof status is not_needed.
  • remove P2: Current review triage priority is none.
  • remove rating: 🐚 platinum hermit: Current review failed before PR readiness was assessed, so no rating label should remain.
  • remove status: 👀 ready for maintainer look: Current PR status no longer selects a status label.
Evidence reviewed

PR surface:

Source +5. Total +5 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 5 0 +5
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 5 0 +5

What I checked:

  • failure reason: invalid structured output.
  • codex failure detail: Codex review failed for this PR with exit 0 and wrote invalid JSON or schema-invalid output to /home/runner/work/clawsweeper/clawsweeper/artifacts/event/codex/93882.json: decision.rootCauseCluster.currentItemRelationship fixed_by_candidate requires a canonical PR.
  • codex stderr: No stderr captured.
  • codex stdout: [],"mergeRiskLabels":[],"mergeRiskOptions":[],"reviewMetrics":[{"label":"Runtime catalog lookup","value":"1 conditional lookup added","reason":"The lookup is limited to native command menus that need unresolved model-aware choices, which is the right scope for the reported Telegram /think menu mismatch."}],"labelJustifications":[{"label":"P2","reason":"This is a normal-priority Telegram command-menu bugfix for live-discovered Ollama reasoning models with limited blast radius."}],"itemCategory":"bug","reproductionStatus":"source_reproducible","reproductionConfidence":"high","requiresNewFeature":false,"requiresNewConfigOption":false,"requiresProductDecision":false,"reproductionAssessment":"Yes. Source inspection reproduces the mismatch: current main passes only the configured catalog to the Telegram /think menu resolver, while the linked issue's live Ollama reasoning capabilit.

Likely related people:

  • unknown: Codex failed before it could trace repository history. (role: review did not complete; confidence: low)
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 proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. P2 Normal backlog priority with limited blast radius. labels Jun 17, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label Jun 17, 2026
@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. labels Jun 17, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label Jun 17, 2026
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 17, 2026
The /think menu in Telegram was only showing 'default, off' for
live-discovered Ollama models because resolveCommandArgMenu used
buildConfiguredModelCatalog (static config) instead of the full
runtime model catalog. Runtime-discovered models (via
'{"ollama/*":{}}' pattern) were missing from the catalog, so
their 'reasoning' capability wasn't available to the thinking
profile resolver.

Fix: load the full runtime catalog via loadModelCatalog() when
building the command arg menu, giving the thinking level resolver
access to all discovered models and their capabilities.

Fixes openclaw#93835
@xydttsw

xydttsw commented Jun 19, 2026

Copy link
Copy Markdown
Author

close all pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram P2 Normal backlog priority with limited blast radius. proof: supplied External PR includes structured after-fix real behavior proof. size: XS

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

1 participant